stopBefore(document, 'getElementById')
stopBefore('document.getElementById') // the same as the previous
stopBefore(Element.prototype, 'removeChild')
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
# Install homebrew. | |
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" | |
# Acquire compiled dependencies. | |
brew install python libxml2 mysql libmemcached openssl swig jpeg redis elasticsearch | |
# Start services. | |
mkdir -p ~/Library/LaunchAgents | |
ln -nfs /usr/local/Cellar/mysql/*/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/ | |
ln -nfs /usr/local/Cellar/redis/*/homebrew.mxcl.redis.plist ~/Library/LaunchAgents/ |
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
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
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
// Credit to damien_oconnell from http://forum.unity3d.com/threads/39513-Click-drag-camera-movement | |
// for using the mouse displacement for calculating the amount of camera movement and panning code. | |
using UnityEngine; | |
using System.Collections; | |
public class MoveCamera : MonoBehaviour | |
{ | |
// | |
// VARIABLES |
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
{ | |
"name": "servers", | |
"windows": [ | |
{ | |
"name": "zamboni", | |
"command": ". ~/s/z-runserver" | |
}, { | |
"name": "solitude", | |
"command": ". ~/s/s-runserver" | |
}, { |
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
var lsCache = function() { | |
var TIMEOUT_DEFAULT = 60; | |
var self = { | |
set: function(key, val, timeout) { | |
var timeout = parseInt(timeout, 10) || TIMEOUT_DEFAULT; | |
var now = Math.round(new Date().getTime() / 1000); | |
localStorage.setItem(key, val); | |
localStorage.setItem(key + '.timeout', now * timeout); | |
}, |
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
for file in `git diff-tree --no-commit-id --name-only -r HEAD | sort | uniq` | |
do | |
if [ ${file: -3} == ".py" ] | |
then | |
flake8 --ignore=E121,E123,E124,E125,E126,E127,E128 $file | |
fi | |
if [ ${file: -3} == ".js" ] | |
then | |
jshint $file | |
fi |
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
# Note: this is not a fully functioning script! You will need to edit paths and other variables manually and it's adviced to run each command manually one after another | |
# install dependencies | |
# http://www.securitylearn.net/tag/deep-analysis-of-itunes-backup/ | |
sudo ARCHFLAGS='-arch i386 -arch x86_64' easy_install pycrypto | |
sudo easy_install M2crypto construct progressbar | |
# clone the decrypt tool source code | |
# hg stands for mercurial | |
hg clone https://code.google.com/p/iphone-dataprotection/ |
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
for file in `git diff-tree --no-commit-id --name-only -r HEAD | sort | uniq` | |
do | |
if [ ${file: -3} == ".py" ] | |
then | |
flake8 --ignore=E121,E123,E124,E125,E126,E127,E128 $file | |
fi | |
if [ ${file: -3} == ".js" ] | |
then | |
jshint $file | |
fi |
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
// “The URL code points are ASCII alphanumeric, "!", "$", "&", "'", "(", ")", | |
// "*", "+", ",", "-", ".", "/", ":", ";", "=", "?", "@", "_", "~", and code | |
// points in the ranges U+00A0 to U+D7FF, U+E000 to U+FDCF, U+FDF0 to U+FFEF, | |
// U+10000 to U+1FFFD, U+20000 to U+2FFFD, U+30000 to U+3FFFD, U+40000 to | |
// U+4FFFD, U+50000 to U+5FFFD, U+60000 to U+6FFFD, U+70000 to U+7FFFD, U+80000 | |
// to U+8FFFD, U+90000 to U+9FFFD, U+A0000 to U+AFFFD, U+B0000 to U+BFFFD, | |
// U+C0000 to U+CFFFD, U+D0000 to U+DFFFD, U+E1000 to U+EFFFD, U+F0000 to | |
// U+FFFFD, U+100000 to U+10FFFD.” | |
// — http://url.spec.whatwg.org/#url-code-points |