Skip to content

Instantly share code, notes, and snippets.

View samueljseay's full-sized avatar

Sam Seay samueljseay

View GitHub Profile
@samueljseay
samueljseay / gist:7779276
Last active December 15, 2023 20:22 — forked from jimbojsb/gist:1630790
Color highlight and copy code for presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

-# HTML5 doctype
!!! 5
!!! strict
!!! XML
%html
-#ie conditionals
/[if IE]
%a{ href: "http://www.mozilla.com/en-US/firefox/" }
@samueljseay
samueljseay / gist:7145313
Created October 24, 2013 21:26
Make your jQuery code play nice with Rails TurboLinks.
$(document).on("page:load",function(){
//do ALL THE THINGS :D
//see http://stackoverflow.com/questions/17386740/rails-4-turbolinks-and-jquery-dynamic-links-not-playing-nice
});
@samueljseay
samueljseay / error
Created November 21, 2012 03:53
tutorial error
1.9.3p327 :013 > pets = %w(rex nibbles fred)
=> ["rex", "nibbles", "fred"]
1.9.3p327 :014 > puts pets.map do |pet|
1.9.3p327 :015 > pet.upcase
1.9.3p327 :016?> end
#<Enumerator:0x007f9b4d02a4f0>
=> nil
1.9.3p327 :017 > puts pets.map(&:upcase)
REX
NIBBLES