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 'formula' | |
class FlashPlayer < Formula | |
url 'http://fpdownload.macromedia.com/pub/flashplayer/updaters/11/flashplayer_11_sa_debug.app.zip' | |
md5 '2770acd6997bfd5016dd51acfb20c025' | |
homepage 'http://adobe.com' | |
version '11.1' | |
def install | |
name = 'Flash Player Debugger.app' |
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
MASTER=`git log --pretty=format:'%H' master | sort` | |
DEV=`git log --pretty=format:'%H' development | sort` | |
for i in `diff <(echo "${MASTER}") <(echo "${DEV}") | grep '^>' | sed 's/^> //'`; | |
do | |
git --no-pager log -1 --oneline $i; | |
done |
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
package { | |
import flash.display.Sprite; | |
import flash.events.Event; | |
import flash.events.MouseEvent; | |
import flash.text.TextField; | |
import flash.text.TextFormat; | |
import flash.external.ExternalInterface; | |
public class Main extends Sprite { |
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 'ostruct' | |
module RelativeModelNaming | |
def model_name | |
ActiveModel::Name.new OpenStruct.new( :name => self.name.split( '::' ).last ) | |
end | |
end | |
# Example usage: | |
class Module::Model |
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 'json' | |
TEMPLATE = <<-HTML | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>Instapaper: Export</title> | |
</head> | |
<body> |
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
namespace :db do | |
desc 'Drop all database connections' | |
task :drop_connections => :environment do | |
database = Rails::Application.config.database_configuration[RAILS_ENV]["database"] | |
field = if ActiveRecord::Base.connection.send( :postgresql_version ) < 90200 | |
'pg_stat_activity.procpic' # PostgreSQL <= 9.1.x | |
else | |
'pg_stat_activity.pid' # PostgreSQL >= 9.2.x | |
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
# Override rails 3.0.17 partial rendering to get information | |
# about the partial we render | |
# put it into config/initializers/rendering.rb | |
module ActionView | |
module Rendering | |
def _render_partial(options, &block) | |
"<b style='float:left;' title='h#{CGI::escapeHTML options.inspect.html_safe}'>*</b>".html_safe + | |
super | |
end | |
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
# PSQL commands | |
alias psql-connect-development='psql `basename $PWD`_development' | |
alias psql-connect-test='psql `basename $PWD`_test' | |
alias psql-connect='psql-connect-development' | |
# Bundler aliases | |
alias be="bundle exec" | |
alias bi="bundle install" | |
alias bl="bundle list" | |
alias bp="bundle package" |
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 canvas, ctx, | |
W, H, color, c_last; | |
function init() { | |
canvas = document.getElementById('c'); | |
ctx = canvas.getContext('2d'); | |
W = window.innerWidth; | |
H = window.innerHeight; | |
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 | |
# | |
# Run specs with great speed and daring-do. | |
# | |
if [ -f zeus.json ]; then | |
zeus cucumber "$@" | |
else | |
bundle exec cucumber "$@" | |
fi |