This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn implementation-comparitor [f1 f2] | |
(let [f1-runtime (atom 0) | |
f2-runtime (atom 0) | |
performance-ratios (atom [])] | |
(fn [& args] | |
(let [f1-start (System/nanoTime) | |
_ (apply f1 args) | |
f1-time (- (System/nanoTime) f1-start) | |
f2-start (System/nanoTime) | |
return (apply f2 args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lsof -i tcp:8090 | grep LISTEN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Switch to the master branch and make sure you are up to date. | |
git checkout master | |
git fetch # this may be necessary (depending on your git config) to receive updates on origin/master | |
git pull | |
# Merge the feature branch into the master branch. | |
git merge feature_branch | |
# Reset the master branch to origin's state. | |
git reset origin/master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; -*- tab-width: 2 -*- | |
;;; These four lines go at the beginning of almost every code file. 16-byte iNES header | |
.inesprg 1 ; one bank of program code | |
.ineschr 1 ; one bank of picture data | |
.inesmap 0 ; we use mapper 0 | |
.inesmir 1 ; Mirror setting always 1 | |
;;; BANKING |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install git-extras | |
git undo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# list process that owns a file | |
lsof | grep myfile | |
# kill all java processes | |
killall -9 java |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo python -m smtpd -n -c DebuggingServer localhost:25 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT pg_terminate_backend(pg_stat_activity.pid) | |
FROM pg_stat_activity | |
WHERE pg_stat_activity.datname = '<db-name>' | |
AND pid <> pg_backend_pid(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ls='ls -AFGh' | |
alias grep='grep --color=auto' | |
alias egrep='egrep --color=auto' | |
alias emacs=/Applications/Emacs.app/Contents/MacOS/Emacs | |
PATH=$PATH:/usr/local/bin | |
PATH=$PATH:~/scripts | |
PATH=/usr/local/opt/ruby/bin:$PATH | |
PATH=/usr/local/Cellar/perl/5.20.1/bin/:$PATH | |
PATH=/usr/local/opt/coreutils/libexec/gnubin:$PATH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Switch back to master | |
git checkout master | |
# Delete all local branches besides master | |
for branch in `git branch | grep -v 'master'` | |
do | |
git branch -D $branch | |
done |