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
function benchmark(method, times, name){ | |
//See http://gist.github.com/227048 | |
var startTime = (new Date()).getTime(), endTime; | |
while(times--){ | |
method(); | |
} | |
endTime = (new Date()).getTime(); | |
console.log(name, endTime - startTime); | |
} | |
var x = 1, y = 0; |
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
// ==UserScript== | |
// @name UTM param stripper | |
// @author Paul Irish | |
// @namespace http://github.com/paulirish | |
// @description Drop the UTM params from a URL when the page loads. | |
// @extra Cuz you know they're all ugly n shit. | |
// @include http://* | |
// ==/UserScript== | |
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 | |
# pre-commit hook to prevent html5 video or audio files from being checked | |
# into the repo. because large binary files in a git repo sucks. bad. | |
media_files=$(git diff --cached --name-only --diff-filter=ACR | \ | |
egrep -i '\.(webm|mp4|ogg|mp3|ogv|m4v|avi|vp8|mov|oga|mp1|mp2|mpeg|3gp|wav)$') | |
if [[ "$media_files" ]]; then | |
echo 'Commit failed. Are you trying to check in media files into the repo?' | |
echo 'ARE YOU A TERRIBLE PERSON?' |
OlderNewer