Archive for the ‘Programming’ Category

TwitterBot Gem Released

Tonight, at one of our (in)famous hack-a-mania nights at Integrum, we released a gem for accessing Twitter through XMPP. Read the full Integrum release article and then go get hacking!
I’m excited because not only did I have a hand in the creation of the twitter_bot gem, but I also helped in the development of [...]

Read the rest of this entry »

RailsConf 2008

I’ll be heading to RailsConf 2008 this week in beautiful Portland, OR. I can’t wait to be in one of my favorite cities again. Especially because I’ll not only be enjoying the city, but also learning from and interacting with the Rails community. If you’re going to be in Portland this weekend, [...]

Read the rest of this entry »

GoRuCo 2008 Wrap-up

As I stated in a previous post, I attended the Gotham Ruby Conference this past weekend in NYC. It was a great time with many interesting talks. The weather was amazing as well. I don’t want to spend a lot of time rehashing the conference because you can view the GoRuCo 2008 [...]

Read the rest of this entry »

Caching Locale-specific Dynamic JavaScript Files

I was recently inspired to create some cached, dynamic JavaScript files for a project I am working on after watching Ryan Bates Railscasts episodes 88 and 89.
The basic concept is to create a JavaScript controller that dynamically renders some JavaScript file(s). This allows you to take advantage of ERB in your JavaScript files. [...]

Read the rest of this entry »

GoRuCo 2008

Next week I will be traveling to New York for the Gotham Ruby Conference courtesy of my favorite Ruby on Rails consulting company in Phoenix. I’ll be attending with Integrum’s resident Agile methodology expert. If you’re in NY or attending the conference, be sure to look us up – see my contact information.

Read the rest of this entry »

Rails Tip: Precision and scale for decimals

For when you need that little bit of extra accuracy, specifying precision and scale for a decimal column in your Ruby on Rails migration is pretty simple. The precision represents the total number of digits in the number, whereas scale represents the number of digits following the decimal point. To specify the precision [...]

Read the rest of this entry »

Rails counter_cache problem

I ran into a strange Ruby on Rails counter_cache problem today. Given the following example models:
class Poll < ActiveRecord::Base
has_many :poll_choices
has_many :poll_votes
end

class PollChoice < ActiveRecord::Base
belongs_to :poll
has_many :poll_votes
end

class PollVote < ActiveRecord::Base
belongs_to :poll, :counter_cache => :votes_count
belongs_to :poll_choice, :counter_cache => :votes_count
end
We want to ensure that the Poll [...]

Read the rest of this entry »

Minor TextMate Annoyance

A recent update to Textmate added a variable to the do snippet. So when you type ‘do’ followed by a tab, you get
do |variable|

end
Most of the time I don’t need a variable, so I want the default ‘do’ snippet to not have a variable.
Open TextMate and use the keyboard shortcut to open the Snippet [...]

Read the rest of this entry »

The Tip of the Ruby #1

I was recently asked about the difference between using or versus || in Ruby and thought it might make a good tip. They essentially do the same thing, but with one difference: operator precedence. You see || is evaluated before an assignment whereas or is evaluated after an assignment. This is why you [...]

Read the rest of this entry »

Search Engine Optimization for Coders

I attended Desert Code Camp this weekend. It is a free technology event in Phoenix, AZ with speakers presenting on a variety of topics. One of the interesting ones I attended today was called SEO for Coders and was presented by Jerry Ferguson. I don’t know much about SEO, just the basics [...]

Read the rest of this entry »