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/ruby -wKU | |
if ARGV.empty? | |
puts "Usage: pullrequest user:branch" | |
exit 1 | |
end | |
url = `git config --get remote.origin.url` | |
unless %r{([^/]+)\.git$} =~ url | |
puts "Unable to determine repo from url (#{url})" |
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
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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
gem 'omniauth' | |
gem 'omniauth-facebook' | |
gem 'clearance' |
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 'coffee_script' | |
require 'rake/clean' | |
def coffee_to_js(coffee) | |
File.join(BUILDDIR, File.dirname(coffee.split('/')[1..-1].join('/')), File.basename(coffee).ext('js')) | |
end | |
JSFILE = 'app.js' | |
JSPATH = "_attachments/js/app/#{JSFILE}" | |
COFFEE = FileList['coffeescript/**/*.coffee'] |
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 'logger' | |
module WithLogLevel | |
def with_log_level(level=Logger::INFO) | |
if logger | |
begin | |
original_level = logger.level | |
logger.level = level | |
yield | |
ensure |
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
/* | |
* Copyright (c) 2010 Tobias Schneider | |
* This script is freely distributable under the terms of the MIT license. | |
*/ | |
(function(){ | |
var UPC_SET = { | |
"3211": '0', | |
"2221": '1', | |
"2122": '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
# credits | |
# http://github.com/hartcode/serverjuice/ | |
# http://blog.fiveruns.com/2008/3/3/compiling-ruby-rubygems-and-rails-on-ubuntu | |
# http://www.rubyinside.com/how-to-install-a-ruby-18-stack-on-ubuntu-810-from-scratch-1566.html | |
# upgrade packages | |
apt-get update | |
apt-get upgrade | |
# install reasonably easy-to-use text editor (skip this if you can wield something greater) |