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
namespace :britt do | |
desc 'Removes trailing whitespace and tabs' | |
task :space do | |
sh %{find . -name '*.rb' -exec sed -i '' -e 's/[`echo -ne "\t"` ]*$//g' {} \\;} | |
end | |
end |
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/sh | |
# first you'll want to create a gist then `git clone` the private url | |
# second you'll want to run this script in the gist's directory | |
while [ 1 ]; do | |
git commit -a -m save && git push origin master; | |
sleep $(echo "60 * 4" | bc); | |
done; |
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
<?php | |
class URLConf | |
{ | |
private $_conf = array(); | |
private $_controller; | |
private $_method; | |
private $_args; | |
private $_default_controller; |
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
from pprint import pprint | |
import re | |
import sys | |
import urllib2 | |
URL = "http://www.modifiedcartrader.com/information/newestCars.aspx" | |
TRANSLATIONS = {(1, "Label1"): "mileage", | |
(1, "Label2"): "hp", | |
(1, "Panel1"): "make", | |
(2, "Label1"): "hp", |
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
# put this in ~/.bash_profile or whatever | |
python_or_python () { | |
if [ "$1" == "" ]; then | |
python | |
else | |
python "$@" | |
fi | |
} | |
alias python="python_or_python" |
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 | |
# | |
############################################################ | |
# BEGIN CONFIG | |
# | |
ZIP_CODE=90210 | |
TIMEOUT=600 # seconds | |
# END CONFIG |
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 | |
CHEF_ROLE=$1 | |
apt-get update; | |
# install ruby and other pre-requisites | |
apt-get install -y \ | |
build-essential \ | |
emacs23-nox \ |
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
options.addOption("h", "help", false, "Print this help message"); | |
options.addOption("v", "version", false, "Print version and exit"); | |
options.addOption("c", "config", false, | |
"Path to topology config file"); |
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
def translate(phrase) | |
phrase.split.inject([]) do |final_pigs, word| | |
char = word.split(//) | |
if char[0].match(/[aeiou]/) | |
final_pigs << "#{word}ay" | |
else | |
new_string = char | |
until new_string[0].match(/[aeio]/) | |
new_string << new_string.shift | |
end |
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
class Book | |
attr_reader :title | |
DONT_CAPITALIZE = %w(and or the an of in a) | |
def title=(title) | |
@title = title.capitalize.split.map do |word| | |
if DONT_CAPITALIZE.include?(word.downcase) | |
word | |
else |
OlderNewer