It took a sweet while, but I am finally beginning to see the value in Continuous Integration. My Zelda gem is now being tested by Travis every time I push code into the repository and I can release my software with confidence.
Continue reading
Category Archives: ruby
Random Active Record
There is no method provided in Active Record to return a random record (to my knowledge). In the past I have used the ever so easy order by rand() for my random record needs. Problem: this is MySQL specific.
Grab the popcorn
Intense debate. Warring factions. Constructive criticism. Fiasco. Unproductive nerd rage. Does this sound intriguing to you? It’s about the current state of Rubygems, a system that distributes Ruby software. TL;DR version: the Rubygems maintainers keep breaking their system and Ruby developers are pissed off.
Sea creature’s blog explains what’s happening in greater detail and it’s fascinating to see unfold in real time. For instance: follow @seacreature, @wycats, @JEG2 and @rbates instead of going to a movie! It’s just as entertaining and you can enjoy it from the couch. Fascinating stuff.
Fixing ASCII-8BIT encoding for Rails 2.3 ERB
The combination of Ruby 1.9 and Rails is so much fun when it comes to character encoding. Words to adequately describe the sheer joy it gives me are hard to find. They are often four-letter though. Maybe that’s significant, I don’t know.
What I do know is this: ERB in Ruby 1.9 and Rails 2.3 will happily force all your templates to ASCII-8BIT while your database strings are most likely UTF-8. Hilarity ensues. There is no way to change this behaviour besides monkeypatching a bunch of internals.
So without further ado here are the monkeypatches: gist.
Drop in config/initializers and enjoy.
Why Ruby is so charming
Part of why the Ruby community is so great is that it seems to attract quirky, ironic, playful and creative people. Can you imagine .NET programmers posting Friday Hugs or Lolcats on their blog? Or libraries named “can haz something”. Nope. It’s why I am extra grateful a person named Avdi has now created a completely serious gem to end all gems. I use it in my production system and it rocks!
Fixing MySQL encoding issues with Ruby 1.9.2
There have been tens, hundreds, thousands blogs posts related to Latin1/UTF8 encoding issues. So here is yet another, this time related to upgrading from Ruby 1.8.6 + mysql gem to Ruby 1.9.2 + mysql2 gem. Continue reading
UPC Customer service FAIL
Honest to God, actual autoreply from UPC (our cable company, possibly the worst customer support in the world):
Let op: onderstaande link verwijst naar een pagina die op dit moment niet in gebruik is. Onze excuses hiervoor.
http://vragen.upc.nl/app/account/profile
Which translates to:
Please note: the link below points to a page which does not exist. Our apologies for this.
Which is just fucking sad. UPC, you suck.
Nerd humor
Specifically: Ruby humor. Thanks lenmeister.
Installing ImageMagick on Snow Leopard
Getting ImageMagick onto your computer would be so incredibly difficult I would often just forgo the entire thing and pray that image manipulation would sort of work on the server. Well, no more. Claudio Poli has written a great bash script to install the whole thing with one command. Clone this repo and execute it. Works perfectly!
Continue reading
ActiveResource Twitter client
Every tech blog should have a post about a Twitter client. Here’s mine. To be fair, my client has only eight seven lines of code, so it rocks.
Continue reading