NOTE: 534 stars, 106 forks. I love you all. Please contribute tips and edits back to this cheat sheet -- email's [email protected] and you can treat gists like git repositories and send git diffs.
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
desc "show changelog" | |
task :changelog do | |
latest = `git tag |tail -1`.chomp | |
system "git log --pretty=format:'* %s %b [%an]' #{latest}..HEAD" | |
end |
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
git merge #{from_branch} -s recursive -X theirs --commit -m 'merge #{from_branch} to #{rails_env}' |
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
# IE is still braindead so still use favicon.ico | |
convert -resize x16 -gravity center -crop 16x16+0+0 -flatten -colors 256 input.png output-16x16.ico | |
convert -resize x32 -gravity center -crop 32x32+0+0 -flatten -colors 256 input.png output-32x32.ico | |
convert output-16x16.ico output-32x32.ico favicon.ico | |
# Then, HTML needs to specify size="XxY" as largest size due to browser bugs | |
<link rel="shortcut icon" href="/favicon.ico" sizes="32x32"> |
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
$ orchard hosts create | |
Orchard username: nateware | |
Password: | |
Default host running at 107.170.120.216 | |
$ orchard docker ps | |
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
$ orchard docker run ubuntu echo hello world |
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
# Create vagrant image | |
vagrant init ubuntu12_64 http://files.vagrantup.com/precise64.box | |
vagrant up | |
vagrant ssh | |
# Fork aws/opsworks-cookbooks on github | |
# https://github.com/aws/opsworks-cookbooks | |
# Clone locally | |
git clone [email protected]:yourusername/opsworks-cookbooks.git | |
cd opsworks-cookbooks |
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
hadoop fs -rmr temp | |
MAHOUT_HOME/bin/mahout org.apache.mahout.cf.taste.hadoop.similarity.item.ItemSimilarityJob --input ~/Workspace/beerstats/beer-ratings-by-userid.csv --output ratings-pearson --similarityClassname SIMILARITY_PEARSON_CORRELATION | |
hadoop jar mahout-examples-0.8-job.jar org.apache.mahout.cf.taste.hadoop.item.RecommenderJob --input ~/Workspace/beerstats/beer-ratings-by-userid.csv --output beer-ratings --similarityClassname SIMILARITY_LOGLIKELIHOOD --maxSimilaritiesPerItem 50 | |
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
import boto | |
from boto.dynamodb.exceptions import * | |
from boto.dynamodb.batch import * | |
import pprint | |
class Leaderboard: | |
def __init__(self, game_mode): | |
self.conn = boto.connect_dynamodb() | |
self.table = self.conn.get_table("leaderboard_" + game_mode) |
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 python | |
# Compare a file on S3 to see if we have the latest version | |
# If not, upload it and invalidate CloudFront | |
import fnmatch | |
import os | |
import boto | |
import pprint | |
import re |
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
# Ruby/Sinatra ELB health check example - GET /healthchk | |
get '/health' do | |
# any DB connection errors below will throw exceptions | |
Timeout.timeout(5) do | |
nkeys = Redis.current.dbsize | |
status = DB.fetch("show engine innodb status").first[:Status] | |
end | |
end |
NewerOlder