Tag Archives: Ruby

Ruby Hash Extensions

As I mentioned before, one of the nice things about Ruby is its malleability. Here are a couple extensions to the Ruby Hash object: class ::Hash def random return self.keys[rand(self.size)] end def byValue(subKey) if subKey self.sort_by {|key, value| value[subKey]}.reverse else … Continue reading

Posted in Coding, Linuxy | Tagged | Leave a comment

Ruby 2 From Source on CentOS 6.4

Ruby‘s autoconf doesn’t alert you to the fact that your system doesn’t have everything it could use. It’ll blindly clear you even though, for example, nothing crypto-related will work. On a fresh CentOS 6.4 install (with EPEL) the following will … Continue reading

Posted in Coding, Linuxy, Work | Tagged , , | 2 Comments

Ruby String.each

While I find Ruby to be a half-assed attempt at an object-oriented Perl, I have been using it quite a bit lately to stay consistent with a lot of existing intellectual property. One of the more maddening things is that … Continue reading

Posted in Coding, Linuxy, Rants/Tirades | Tagged , | 1 Comment