This file contains 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
rates = jQuery(".rate"); | |
for(i in rates) { | |
rate = rates[i].innerHTML; | |
if(rate){ | |
matches = rate.match(/\$([\d.]+) per hour/i); | |
if(matches instanceof Array) { | |
rates[i].innerHTML = "$"+ Math.ceil(parseFloat(matches[1])*100*(365/12)*24)/100 + " per month"; | |
} | |
} | |
} |
This file contains 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
// Mac Lion using homebrew | |
{ | |
"cmd": ["/usr/local/opt/php54/bin/php", "/usr/local/bin/phpunit", "$file"] | |
} | |
// Ubuntu 12.04 with pear-installed PHPUnit | |
// Ctrl + B to run phpunit | |
// Ctrl + Shift + B to run the script |
This file contains 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_size": 4, | |
"translate_tabs_to_spaces": true | |
} |
This file contains 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
<?php | |
$f = fopen('php://stdin', 'r'); | |
while ($line = fgets($f)) { | |
// do stuff | |
} | |
fclose($f); |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style type="text/css"> | |
body { | |
background-color: #333; | |
font: 60px 'Helvetica, Arial, Ubuntu, sans-serif'; | |
color: #111; | |
} | |
h1 { |
This file contains 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
#!/usr/bin/env bash | |
if [ $EUID != 0 ]; then | |
"This script must be run with sudo" | |
exit $? | |
fi | |
echo " Installing dependencies" | |
apt-get install ia32-libs -y # Note: This dep is a bit overkill but it's useful anyway | |
ln -s /usr/lib/i386-linux-gnu/libgnome-keyring.so.0 /usr/lib/libgnome-keyring.so.0 |
This file contains 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
jslint `find . | grep "\.json$"` |
This file contains 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 | |
set -x | |
if [ $# == 2 ]; then | |
echo ">>> Cleaning up existing chef environment" | |
knife node delete -y $2 | |
knife client delete -y $2 | |
ssh -l root $2 'yum remove -y chef' | |
ssh -l root $2 'rm -rf /etc/chef' | |
ssh -l root $2 'rm -rf /opt/chef' | |
echo ">>> Bootstrapping $1 $2" |
This file contains 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 | |
if [ $# == 1 ]; then | |
echo "adding ssh key to root on $1" | |
ssh $1 'sudo mkdir /root/.ssh/ || sudo chmod 700 /root/.ssh/' | |
cat ~/.ssh/id_rsa.pub | ssh $1 'sudo tee -a /root/.ssh/authorized_keys' | |
exit 0 | |
else | |
echo "wrong number of parameters" | |
exit 1 | |
fi |
This file contains 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
ZSH=$HOME/.oh-my-zsh | |
ZSH_THEME="robbyrussell" | |
plugins=(git) | |
source $ZSH/oh-my-zsh.sh | |
export EDITOR=vim | |
# Java | |
export JAVA_HOME=`/usr/libexec/java_home -v 1.6` |