13 February 2011 ~ 1 Comment

Stock info with ystock

A new side project I have been working on is in the financial industry. This project needs to pull stock information such as; price, change, and volume of a any stock. The source i will be getting this information from is Yahoo! Finance. Yahoo produces a cvs file with just the information i need, so it’s good news! The next task is to build something i can use over and over, something portable i can take from this project and implement on the next.

Continue Reading

28 January 2011 ~ 1 Comment

Array to a hash in Ruby

A WordPress MU API on Rails I have been working a WordPress MU API for the company I work for and came across a use for converting an array into a hash. The API is in Ruby on Rails, and the client that is making the request is PHP. The php script is posting an [...]

Continue Reading

10 January 2011 ~ 1 Comment

Ruby and Rails Delegate

Delegation is a quite common practice in Ruby projects, if you consider proxies, mix ins and composition as the ingredient of the Delegation Pattern. The Delegation Design Pattern is a technique where an object exposes certain behavior but it actually delegates responsibility for implementing that behavior to an associated object.

Continue Reading

10 December 2010 ~ 1 Comment

4 ways to use Symbols in Ruby

A typical implementation of a Ruby interpreter maintains a symbol table in which it stores the names of all the classes, methods, and variables it knows about. This also allows such an interpreter to avoid most string comparisons: it refers to a method name by their position in this symbol table. This turns a relatively expensive string operation into a relatively cheap integer operation.

Continue Reading

21 November 2010 ~ 3 Comments

Simple DB

Amazon SimpleDB is a web service for storing, maintaining, and querying structured data sets in real time. All data is stored in Amazon’s web service cloud, making SimpleDB very reliable, scalable, and flexible. I am going to go over all you need to start using Simple DB with Ruby on Rails.

Continue Reading

21 October 2010 ~ 1 Comment

Install Passenger

Passenger makes deploying rails apps as easy as putting the file on the server and starting Apache. I have been using passenger for about 4 years and have used it for some very high scale projects.

Continue Reading

20 October 2008 ~ Comments Off

Using remote_function

This wonderful built-in function is a great way to make easy Ajax calls. In this example I will show you how to use remote_function with the onClick call, and also within a JavaScript function. First, lets make a checkbox called finish; this link will send the id of the item to the database to be [...]

Continue Reading

14 October 2008 ~ Comments Off

Winn Scriptatype: 1.7

I wanted to re-cap the new adds in 1.7 for rails. The new method calls are as listed: # Added V1.7b textlink_do_fade textlink_do_puff textlink_do_blindup textlink_do_dropout You can build any of the above calls with: textlink_do_fade(’Link Text’,'divYouWantToUpdate’,{***},{****}) Visit the project for more info on how to use the latest methods and more. Winn Scriptatype project home [...]

Continue Reading

03 April 2008 ~ Comments Off

WinnScriptatype:Rails v1.7b

I just released WinnScriptatype version 1.7 beta on the RubyForge project page. I have also made some fixes to version 1.5 and it is now production ready. The latest release has added some new functionality and the ability to make calls to display text. The call still supports the effects and Ajax request url along [...]

Continue Reading

26 March 2008 ~ 1 Comment

Rails Plugin: WinnScriptatype

Making an Ajax checkbox just got easy. This very simple plugin was built for my own use. The idea was to make one call for my checkbox, update to the database, and an effect. This plugin is easy to use and install, i dont have it setup in an svn yet so you will need [...]

Continue Reading

25 March 2008 ~ Comments Off

Magic Multi-Connections

This plug-in is a great one! I have found a few bugs but it did the job just as i needed it to. I am using this plug-in to connect to three databases, where i am selecting, updating, inserting, and deleting. By adding this plug-in i was able to set my databases in the database.yml [...]

Continue Reading

01 March 2008 ~ Comments Off

visual_effect with a delay

One of the coolest things I ran across in RJS was the delay method. This delay method will do just that and delay a number of seconds. So lets say you need to highlight something that was just added to the page after the user submits it. I would like it to add to the [...]

Continue Reading

19 February 2008 ~ 1 Comment

Highlight your UI with rails

If you find yourself needing to highlight something after your Ajax call comes back and is finished. Why not highlight it? If your making a call with remote_function, link_to_remote or other then add this small line of code on. Problem solved! [ruby] :complete => visual_effect(:highlight, ‘theDivId’) [/ruby] Just give it the div or element id [...]

Continue Reading

17 February 2008 ~ Comments Off

Listing files in a directory with Rails

In a recent application I am building I needed to pull file names and directory names from a local directory. I searched all over the net for this and found nothing. After reviewing a few of rails built in functions I came across Dir.glob(). If you feed this method a path to a directory it [...]

Continue Reading

16 February 2008 ~ Comments Off

How to download files with a Ruby

For a project that I’m working on, I want to download a set of pictures from flickr once a day. In this way, my Rails app won’t need to access the flickr api – it can just grab the pics out of an images directory. I figured that it would be an awfully easy task [...]

Continue Reading