curl https://raw.github.com/gist/1211490/afc8c6ff2221fced522388a4220397c1a7c5ece3/build.sh | sh
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
# Just drop this little diddy in your app to get some (not perfect) information on query times and such | |
# This will eventually become an official plugin but for those who can't wait, enjoy. | |
if defined?(NewRelic) | |
module MMNewRelicTracing | |
def self.included(model) | |
meths = %w[find find! paginate first last all count create create! update delete delete_all destroy destroy_all exists? find_by_id increment decrement set push push_all push_uniq pull pull_all] | |
model.metaclass.class_eval do | |
meths.each do |meth| |
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
$.getJSON('http://api.flickr.com/services/rest/?method=flickr.places.getInfo&api_key=get_your_own&woe_id=44418&format=json&jsoncallback=?', function(data) { | |
if(data.place.has_shapedata == 1) { | |
var bounds = new GLatLngBounds(); | |
$.each(data.place.shapedata.polylines.polyline, function(index,polyline) { | |
thepoints = []; | |
$.each(polyline._content.split(/ /), function(pindex, point) { | |
lat = parseFloat(point.split(/,/)[0]); | |
lng = parseFloat(point.split(/,/)[1]); | |
thepoints[pindex] = new GLatLng(lat, lng); | |
}); |
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/sh | |
### BEGIN INIT INFO | |
# Provides: mongodb | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the mongodb data-store | |
# Description: starts mongodb using start-stop-daemon |
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 Setup | |
#---------------------------------------------------------------------------- | |
file '.gitignore', <<-FILE | |
.DS_Store | |
log/*.log | |
tmp/**/* | |
config/database.yml | |
db/*.sqlite3 | |
public/uploads/* |
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
require 'minitest/unit' | |
require 'minitest/spec' | |
require 'ansi' | |
class MiniTest::Unit | |
include ANSI::Code | |
PADDING_SIZE = 4 | |
def run(args = []) |
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
# | |
# Halftoneapp.com Sample Bluepill Configuration File | |
# Read more at: http://blog.halftoneapp.com | |
# | |
# Set paths | |
home_dir = "/home/railsapp" | |
rails_shared = "#{home_dir}/app/shared" | |
unicorn_path = "/path/to/unicorn_rails" |
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
Day job: Code Wranglers | |
Favorite Python project: pystache | |
Favorite Conference: CodeConf | |
Python Experience Level: Beginner |
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
# Set cache dir | |
proxy_cache_path /var/cache/nginx levels=1:2 | |
keys_zone=microcache:5m max_size=1000m; | |
# Virtualhost/server configuration | |
server { | |
listen 80; | |
server_name yourhost.domain.com; | |
# Define cached location (may not be whole site) |
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 ruby | |
#gem_cmd = ENV["GEM_CMD"] || 'sudo gem' | |
gem_cmd = 'gem' | |
STDIN.map { |l| l.strip }.each { |l| | |
gem, versions = l.split(' ', 2) | |
versions = versions.gsub(/[\(\)]/, '').split(', ') | |
versions.each { |version| | |
cmd = "#{gem_cmd} install #{gem} -v #{version} --no-ri --no-rdoc" |
OlderNewer