start new:
tmux
start new with session name:
tmux new -s myname
<!doctype html> | |
<html> | |
<head> | |
<title>iFrame memory leak prevention test</title> | |
</head> | |
<body> | |
<h1>iFrame memory leak prevention test (void)</h1> | |
<p>In IE up through version 8 adding an iframe to a page and | |
removing it produces a memory leak in some cases. The pattern |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
(global-set-key (kbd "C-c C-r") 'run-mocha) | |
(defun run-mocha() | |
"Runs all the tests in the current buffer" | |
(interactive) | |
(let* (command result exit-value) | |
(setq command (concat "mocha -r should " (buffer-name))) | |
(setq exit-value (shell-command command)) | |
(color-modeline exit-value))) |
function killport { | |
if [ $1 == '-h' ] || [ -z $1 ]; then | |
echo '`killport <PORT>` finds the process listening to the specified port and kills it.' | |
else | |
process_line=`sudo lsof -i :$1 | tail -1` | |
if [ "$process_line" == "" ]; then | |
echo "no processes listening on $1" | |
else | |
process_name=`echo "$process_line" | awk '{print $1}'` | |
echo "killing $process_name" |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
#!/bin/sh | |
# | |
# A git hook script to find and fix trailing whitespace | |
# in your commits. Bypass it with the --no-verify option | |
# to git-commit | |
# Ref - http://is.gd/PerowD | |
# | |
if git rev-parse --verify HEAD >/dev/null 2>&1 | |
then |
;; emacsd-tile.el -- tiling windows for emacs | |
(defun swap-with (dir) | |
(interactive) | |
(let ((other-window (windmove-find-other-window dir))) | |
(when other-window | |
(let* ((this-window (selected-window)) | |
(this-buffer (window-buffer this-window)) | |
(other-buffer (window-buffer other-window)) | |
(this-start (window-start this-window)) |