Skip to content

Instantly share code, notes, and snippets.

@djburdick
djburdick / gist:6372204
Created August 28, 2013 22:30
exit code. #linux
find the last exit code of a program.
$ echo $?
@djburdick
djburdick / gmail_shortcuts
Created July 21, 2013 23:14
gmail shortcuts. #browser
compose - c
scroll - j,k
reply - r
fwd - f
reply all - a
delete - #
read/unread - shift + i, shift + u
select message - x
back to inbox - u
@djburdick
djburdick / query_mysql_without_cache
Created July 9, 2013 22:01
query mysql without caching (for benchmarking). #mysql
SELECT SQL_NO_CACHE COUNT(*) FROM `table`;
@djburdick
djburdick / git_single_file_history
Created June 30, 2013 01:33
git graphical version of single file history. #git
gitk path/to/filename
@djburdick
djburdick / check_to_see_if_sending_gzip
Created June 6, 2013 04:06
checking to see if a site is sending gzipped data. #linux
curl -H "Accept-Encoding:gzip" https://www.google.com/
// not gzipped
curl -H "Accept-Encoding:gzip" https://github.com/ | gunzip
// gzipped
@djburdick
djburdick / set_upstream_tracking_for_current_local_branch
Created May 28, 2013 19:46
set upstream tracking for a branch that already exists locally. #git
$ git branch --set-upstream master origin/master
# useful if you've used git flow init and it created a bunch of local branches that don't track the remotes
@djburdick
djburdick / prevent_mac_from_sleeping
Created May 25, 2013 20:07
Command line prevent mac from falling asleep. #mac
caffeinate -is
# -i prevent idle sleep
# -s prevent system sleep
@djburdick
djburdick / merge_conflicts_take_our_or_theirs
Created May 25, 2013 19:50
Merge conflict take ours or theirs. #git
git co --theirs config/routes.rb
# theirs means the branch you are merging into the current branch
git co --ours config/routes.rb
# ours means the current branch
@djburdick
djburdick / crontab_on_mac_osx
Created May 23, 2013 20:20
setting up crontab on mac osx. #mac
crons aren't created by default for mac users now.
you need to:
$ sudo su -
$ crontab -u username -e
@djburdick
djburdick / linux_command_execution_time
Created May 22, 2013 21:53
benchmark how long a command takes to run. #linux
$ time command