We’re Hiring

September 30th, 2009 By: brian

Moki Systems is seeking a full-time Ruby on Rails developer. The person should be a self starter, willing and able to figure things out on their own. Applicant should have experience with Ruby on Rails, MVC programming concepts, MySQL and/or PostgreSQL experience and the ability to learn new technologies. Any additional programming experience is a plus.

This is a full-time position with a 90-day probationary period after which medical benefits and paid holidays are available. Salary is competitive and depends on experience.

Send a resumé to:

Kelli Valadez

Contact Phone:
435-674-3571

Contact Email:
hr@mokisystems.com


Linux Clipboard Snippets

September 4th, 2009 By: Daniel

Whenever I find myself typing the same thing over and over again, I have to come up with some way to avoid the repetition. And one thing I do a lot is fill out web forms that require things like credit card numbers and unique email addresses. For a while I tried using Parcellite (a clipboard manager) but it wasn’t really designed for what I wanted to use it for. Finally with the inspiration of this thread I was able to cobble together a solution that does just what I want.
Read the rest of this entry »


Savings records that fail validation.

June 9th, 2009 By: Daniel

So I had this problem with a record that was being saved even though it failed validation:

cc = CreditCard.new(:card_number => 'invalid')
>> cc.save
=> false
>> cc.id
=> 3

That one had me stumped for a while until I realized I was carelessly using update_attribute in my custom writer:

def card_number=(num)
  update_attribute(:crypted_card_number, encrypt(num))
end

And we all know that update_attribute “saves the record without going through the normal validation procedure.”

Everything worked much nicer after I changed the code to:

def card_number=(num)
  self.crypted_card_number = encrypt(num)
end

Ruby thinks (19.99 * 100).to_i = 1998

March 26th, 2009 By: Daniel
>> (19.99 * 100).to_i
=> 1998
>> (9.99 * 100).to_i
=> 999

Someone please tell me what’s up with that!

In the meantime:

>> (19.99 * 100).to_s.to_i
=> 1999