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
function _git_branch_name | |
echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||') | |
end | |
function _git_initialized_repo | |
test (git rev-parse --git-dir ^/dev/null | wc -l) -gt 0 | |
end | |
function _git_commit_exists | |
test (git log ^&1 | grep --count "^fatal") -eq 0 |
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
Y | |
OOOO | |
OOOO | |
OOOOOOOOOOO | |
OOOO |
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
/* | |
* | |
* Mongo-Hacker | |
* MongoDB Shell Enhancements for Hackers | |
* | |
* Tyler J. Brock - 2013 | |
* | |
* http://tylerbrock.github.com/mongo-hacker | |
* | |
*/ |
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
Before do |scenario| | |
DeferredGarbageCollection.start | |
end | |
After do |scenario| | |
DeferredGarbageCollection.reconsider | |
end | |
at_exit do | |
DeferredGarbageCollection.stop |
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
for file in db/migrate/*; do | |
echo "$(date -r $(git log --format=%at $file | tail -n1) +%Y%m%d%H%M%S) $file"; | |
done; | |
20070401155320 db/migrate/004_add_timezone.rb | |
20070401155320 db/migrate/005_user_interface_type.rb | |
20070401155320 db/migrate/006_user_external_clients.rb | |
20070401155320 db/migrate/007_user_show_calendar.rb | |
20070401155320 db/migrate/008_client_css.rb | |
20070401155320 db/migrate/009_add_tasks_company_id.rb |
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 |
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
# 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
# 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
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 |