Skip to content

Instantly share code, notes, and snippets.

View jboursiquot's full-sized avatar

Johnny Boursiquot jboursiquot

View GitHub Profile
@jboursiquot
jboursiquot / keybase.md
Created March 28, 2014 00:11
keybase.md

Keybase proof

I hereby claim:

  • I am jboursiquot on github.
  • I am jboursiquot (https://keybase.io/jboursiquot) on keybase.
  • I have a public key whose fingerprint is ED6D 593E 5733 2FC8 7CD8 9B22 036A F617 84D5 062D

To claim this, I am signing this object:

@jboursiquot
jboursiquot / fizzbuzz.rb
Last active August 29, 2015 14:00
Counting incrementally to 100, print "fizz" any number divisible by 3 and "buzz" any number divisible by 5. Should the number be divisible by 3 and 5, print "fizzbuzz".
# Counting incrementally to 100, print "fizz" any number divisible by 3 and "buzz" any number divisible by 5. Should the number be divisible by 3 and 5, print "fizzbuzz".
@jboursiquot
jboursiquot / hashes_and_collections.md
Last active August 29, 2015 14:00
Hashes and collections

Given a CSV document with three columns, firstname, lastname, and email, please read that file into a data structure that I can use to:

  1. List every person found in the CSV by firstname, lastname and email
  2. Find a person's information by email
@jboursiquot
jboursiquot / implement-each.rb
Created May 5, 2014 14:19
How would you implement 'each' on Ruby's `Array` class (without using another enumerator like map).
# How would you implement 'each' on Ruby's `Array` class (without using another enumerator like map).
@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