Skip to content

Instantly share code, notes, and snippets.

@tmr08c
tmr08c / gist:2775409
Created May 23, 2012 14:06 — 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
@tmr08c
tmr08c / how_i_git.md
Created May 5, 2016 22:00
Notes for a Dev Talk on some of the things I use Git for.

Aliases

Inspired by Ben Orienstein's talk.

Use this:

history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl |  head -n10
## Splatting an array
arr = [1, 2, 3]
a = [arr, 4]
# => [[1, 2, 3], 4]
b = [*arr, 4]
# => [1, 2, 3, 4]
## Default array as argument
bad = Hash.new([])
bad[1] <<= 1
bad[2] <<= 2
bad
# => {1=>[1, 2], 2=>[1, 2]}
## Default array from block