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 | |
echo "Setting up chef..." | |
sudo apt-get -y update | |
sudo apt-get -y install ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert | |
cd /tmp | |
wget http://rubyforge.org/frs/download.php/57643/rubygems-1.3.4.tgz | |
tar zxf rubygems-1.3.4.tgz |
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
task :deploy => ['deploy:push', 'deploy:restart', 'deploy:tag'] | |
namespace :deploy do | |
task :migrations => [:push, :off, :migrate, :restart, :on, :tag] | |
task :rollback => [:off, :push_previous, :restart, :on] | |
task :push do | |
puts 'Deploying site to Heroku ...' | |
puts `git push heroku` | |
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
require.registerExtension('.js', function(js){ | |
return js.replace(/^ *\/\/debug: */gm, ''); | |
}); |
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
$ node ts.js | |
10 Jan 15:01:23 - prepared | |
10 Jan 15:01:24 - started | |
PUT /riak/airlines/KLM | |
10 Jan 15:01:24 - saved | |
10 Jan 15:01:24 - cleared | |
GET /riak/airlines/KLM | |
10 Jan 15:01:24 - not found! it works |
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
# This knife.rb orig. provided by jtimberman@opscode.com - but any mistakes are mine! | |
current_dir = File.dirname(__FILE__) | |
platform = "https://api.opscode.com/organizations" | |
require 'grit' | |
branch = Grit::Repo.new("#{current_dir}/..").head.name | |
case branch |
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.extensions[".json"] = function (module, filename) { | |
module.exports = JSON.parse(require("fs").readFileSync(filename, "utf8")) | |
} |
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
### | |
Modified from https://github.com/jashkenas/coffee-script/blob/master/Cakefile | |
Part of an upcoming PeepCode screencast. This snippet is MIT Licensed. | |
### | |
{spawn, exec} = require 'child_process' | |
task 'assets:watch', 'Watch source files and build JS & CSS', (options) -> | |
runCommand = (name, 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
describe("AjaxForm", function() { | |
// Local vars for manipulation | |
var $form = null, | |
_requirejs_loaded = false, | |
found_errors = false, | |
submitted_successfully = false, | |
AjaxFormInstance = null, | |
RequireJSViews = { | |
AjaxFormView: null |
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
# Extend jQuery objects with Underscore collection methods. | |
# | |
# Each collection method comes in two flavors: one prefixed | |
# with _, which yields a bare DOM element, and one prefixed | |
# with $, which yields a jQuery-wrapped element. | |
# | |
# So if `this` is a jQuery object, instead of: | |
# | |
# _.max @, (el) -> $(el).height() | |
# |
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
# Conditional decrement. | |
# | |
# Decrement the value of a key only if the current value is greater than | |
# a specified value. | |
require 'rubygems' | |
require 'redis' | |
r = Redis.new | |
cond_decr = <<LUA |
OlderNewer