Skip to content

Instantly share code, notes, and snippets.

View jboursiquot's full-sized avatar
📆
GopherCon

Johnny Boursiquot jboursiquot

📆
GopherCon
View GitHub Profile
@jboursiquot
jboursiquot / gist:4029430
Created November 7, 2012 03:27
Create isolated gemset with rvm
rvm use 1.9.3@my_project --create --rvmrc
@jboursiquot
jboursiquot / gist:4150506
Created November 26, 2012 20:45
Tracking progress through tests
require_relative '../spec_helper'
describe "My API" do
it "should return a list of cities (e.g. New York, Berlin)"
it "should return a list of course categories"
it "should return a list of courses based on a given city"
it "should return a list of courses based on a category and city"
end
@jboursiquot
jboursiquot / gist:4196639
Created December 3, 2012 17:41
Installing tiny_tds ruby gem
gem install tiny_tds -- --with-freetds-include=/usr/local/include --with-freetds-lib=/usr/local/lib --with-iconv-include=/usr/local/Cellar/libiconv/1.14/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib
@jboursiquot
jboursiquot / gist:4216037
Created December 5, 2012 14:46
Adding element to array that may not yet exist
# Given:
hash = {}
(('a'..'z').to_a+('a'..'z').to_a).shuffle.each do |e|
# represent the following two lines as a one-liner
hash[:"#{e}"] ||= []
hash[:"#{e}"] << rand(10)
end
# one-liner for the two-liner above
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.48771023750305176</real>
<key>Green Component</key>
<real>0.48781105875968933</real>
@jboursiquot
jboursiquot / gist:4337190
Created December 19, 2012 14:52
SVN ignore at the command line
(Source: http://blog.bogojoker.com/2008/07/command-line-svnignore-a-file/)
# ---------------------------------------------------------------------
# Ignore all the .txt files in the /trunk/Blah/ directory
# ---------------------------------------------------------------------
# Go to the directory
cd trunk/Blah/ # The directory with the files
# Start editing the properties for the current directory
@jboursiquot
jboursiquot / gist:4369840
Created December 24, 2012 16:20
Ruby.gitignore
*.gem
*.rbc
.bundle
.config
coverage
InstalledFiles
lib/bundler/man
pkg
rdoc
spec/reports
@jboursiquot
jboursiquot / gist:4530041
Created January 14, 2013 13:23
Stringify activerecord errors
o.errors.full_messages.join(', ')
@jboursiquot
jboursiquot / gist:4551385
Last active December 11, 2015 05:19
libstc++5
http://mirror.pnl.gov/ubuntu//pool/universe/g/gcc-3.3/libstdc++5_3.3.6-20~lucid1_amd64.deb
deb http://mirror.pnl.gov/ubuntu/ lucid-backports main universe
@jboursiquot
jboursiquot / vim-remove-m-newlines
Created March 12, 2013 16:44
Remove ^M line endings using Vim
:%s/<Ctrl-V><Ctrl-M>//g