Zac Hallett


Roon
3 minute read

ActiveSupport::Inflector and you!

Setup

Ruby on Rails is a framework that has convention over configuration in mind. In part of having this paradigm in place, Rails expects certain files to be located in particular places with file names matching the class definition within that file. A...

Continue Reading
2 minute read

Base64#decode64 does bad things (if you are expecting UTF-8 encoded strings)

Base64#decode64 does bad things (if you are expecting UTF-8 encoded strings)

In debugging a problem with broken bytes being shown in the browser where we were decoding base64 strings, I stumbled upon how Base64#decode64 returns strings once they are...

Continue Reading
3 minute read

Intro to Forking inside Ruby

Intro to forking inside Ruby

In digging through some old scripts, I stumbled upon a CPU load testing script I had gotten from an old colleague written in Perl using threading.

cpu_load.pl

#!/usr/bin/perluse strict;use warnings;use threads;my $NUM_THREADS...
Continue Reading
5 minute read

HOWTO: Ruby C Extension with a static Library

How to wrap a static C library with Ruby

Several months ago I was tasked with implementing an appliance into our Ruby on Rails infrastructure. I could have either chosen to do it via cURL calls and pure C, or wrap the static C libraries the vendor...

Continue Reading