Skip to content

Instantly share code, notes, and snippets.

/*!
* domready (c) Dustin Diaz 2012 - License MIT
*/
var domReady = (function (ready) {
var fns = [], fn, f = false
, doc = document
, testEl = doc.documentElement
, hack = testEl.doScroll
, domContentLoaded = 'DOMContentLoaded'
@doctyper
doctyper / % Shortcut to Placeholder.tmSnippet
Created October 26, 2012 18:01
Placeholder Shortcut for Sublime Text 2 / TextMate
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>@extend %$0;</string>
<key>name</key>
<string>% Shortcut to Placeholder</string>
<key>scope</key>
<string>source.scss</string>
brew update
brew install rbenv
brew install ruby-build
echo 'eval "$(rbenv init -)"' >> ~/.profile
exec $SHELL
rbenv install 1.9.3-rc1
rbenv rehash
rbenv global 1.9.3-rc1
exec $SHELL
@doctyper
doctyper / one-line-install.sh
Created October 12, 2012 19:19
How to replace Safari 6's inspector with WebKit's inspector.
curl -L https://raw.github.com/gist/3880960/db03e2ba7e519f7431f35aaddcf4a5899669aec4/revert-safari-inspector.sh | bash
@doctyper
doctyper / gist:3718320
Created September 13, 2012 22:50
Uninstall all NPM modules
npm list -g | awk '/@/ {print $2}' | grep '@' | awk -F@ '{print $1}' | xargs npm -g uninstall
pip install git+ssh://git@github.com/ff0000/django-start.git --upgrade
@doctyper
doctyper / gist:1644192
Created January 20, 2012 01:07
Just some animation SCSS mixins.
@mixin animation($animation, $animation-2: none, $animation-3: none) {
@each $prefix in webkit, moz, ms {
#{""}-#{$prefix}-animation: $animation, $animation-2, $animation-3;
}
}
@mixin animation-name($name) {
@include experimental(animation-name, $name);
}
@doctyper
doctyper / gist:1421667
Created December 2, 2011 03:55
Sets new branch remote/merge config options
BRANCH=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'); git config branch.$BRANCH.remote origin; git config branch.$BRANCH.merge refs/heads/$BRANCH
@doctyper
doctyper / gist:1411283
Created November 30, 2011 22:11
Add latency to localhost
# enable
sudo ipfw pipe 1 config bw 50KBytes/s delay 100ms
sudo ipfw add 1 pipe 1 src-port 80
sudo ipfw add 2 pipe 1 dst-port 80
# disable
sudo ipfw delete 1
sudo ipfw delete 2
@doctyper
doctyper / gist:1359906
Created November 12, 2011 02:10
Check to see if we are on master branch. Stop accidental commits
#!/bin/sh
# Check to see if we are on master branch. Stop accidental commits
if [ $(git symbolic-ref HEAD 2>/dev/null) == "refs/heads/master" ]
then
if [ -f i_want_to_commit_to_master ]
then
rm i_want_to_commit_to_master
exit 0
else
echo "Cannot commit to master branch"