Code, Strings, and Keys

    • About Thomas Powell
    • Account
    • It’s been [0] days since [program] last updated
    • Login
    • Password Reset
    • Pianist / Accompanist / Music Director Resume
    • Reading List 2025
    • Register
    • Running Gear – Shoes, Treadmill, and Bandages
    • Site Map
Illustration of a bird flying.
  • On Mac OSX Lion: “ERROR: Error installing ruby-oci8: ERROR: Failed to build gem native extension”

    Running Mac OSX Lion, trying to bundle install a project that included the ruby-oci8 gem, I received the following error: Building native extensions. This could take a while… ERROR: Error installing ruby-oci8: ERROR: Failed to build gem native extension. The fix: Fortunately, the 64-bit client for Oracle has now been updated for Lion/Mountain Lion. Download…

    April 11, 2013
  • zsh grep and mvim: search for a string in a directory in file type, and open that point

    open_all {pattern} {extension} #!/bin/zsh grep -n $1 **/*$2 | sed ‘s/^([a-zA-Z_/.]*):([0-9]*).*$/2 1/’ | while read line file do mvim –remote-tab-silent +$line $file done Usage: # find all occurrences of “def” as a whole word and open the files in separate tabs: open_all ” .rb

    December 5, 2012
  • Fun with the Ruby & (unary ampersand) and String#to_proc

    In trying to grasp the unary & operator in ruby, I ran across [Stupid Ruby Tricks: String#to_proc]. Therefore, I decided I had to further twist the language features to my own will. Like many things in Ruby with duck-typing, the following syntax: (‘a’..’z’).map &:upcase …makes use of the fact that Symbol has a #to_proc method,…

    December 3, 2012
←Previous Page
1 … 79 80 81 82 83 … 312
Next Page→

Code, Strings, and Keys

Proudly powered by WordPress