Skip to content

Instantly share code, notes, and snippets.

View geoffalday's full-sized avatar

Geoff Alday geoffalday

View GitHub Profile
@geoffalday
geoffalday / gist:4189584
Created December 2, 2012 16:24 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@geoffalday
geoffalday / gist:1322089
Created October 28, 2011 11:22 — forked from trvsdnn/gist:1321710
twitter_link
def twitter_link(handle)
avatars_path = 'public/img/avatars/'
avatar = handle + '.jpg'
avatar_path = avatars_path + avatar
img_tag = "<img src='#{avatar_path.sub(/^public/, '')}' />"
# Check and see if there's already an avatar.
unless File.exists?(avatar_path)
# We don't have it. Let's try to get it from Twitter.
begin