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 | |
# put this to .git/hooks/pre-commit | |
function check_commit_stopper { | |
COMMIT_STOPPER=$1 | |
if [ `git diff HEAD | grep $COMMIT_STOPPER | wc -l` -gt 0 ]; then | |
echo "$COMMIT_STOPPER detected, aborting commit." | |
echo "" | |
git grep -n --heading --break $COMMIT_STOPPER -- `git diff HEAD --name-only` | |
exit 1 |
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
rspec --require ./lib/rspec_debug_formatter.rb --format RSpecDebugFormatter --seed 8812 --fail-fast spec/ |
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
RSpec::Matchers.define :match_schema do |schema_name| | |
match do |json| | |
schema = Rails.root.join("/path/to/your/schemas/#{schema_name}.json") | |
@errors = JSON::Validator.fully_validate(schema, json) | |
@errors.none? | |
end | |
failure_message_for_should do | |
@errors.first |
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 | |
/etc/init.d/postgresql stop | |
TMPDIR=/tmp/tmpfs; # the actual mount point for the tmpfs | |
MOUNTPOINT=/var/lib/postgresql/ | |
umount $MOUNTPOINT | |
umount $TMPDIR |
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
" Switch syntax highlighting on, when the terminal has colors | |
" Also switch on highlighting the last used search pattern. | |
if &t_Co > 2 || has("gui_running") | |
syntax on | |
set hlsearch | |
endif | |
"if has("gui_running") | |
" GUI is running or is about to start. | |
" Maximize gvim window. |
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
module ActiveRecord | |
module Tasks # :nodoc: | |
module DatabaseTasks # :nodoc: | |
extend self | |
attr_writer :current_config | |
LOCAL_HOSTS = ['127.0.0.1', 'localhost'] | |
def register_task(pattern, task) |
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
# On Heroku we'll read the config from ENV | |
if postgres = URI.parse(ENV['DATABASE_URL'] || '') | |
ActiveRecord::Base.configurations[:production] = { | |
:adapter => 'postgresql', | |
:encoding => 'utf8', | |
:database => postgres.path[1..-1], | |
:username => postgres.user, | |
:password => postgres.password, | |
:host => postgres.host | |
} |
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
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyTKOQBxGZjvxAaJWrIBI/ljyxfPmcxQdpDgPXShPdyG49W08i/OJf6Fs+feKJIFjMe0/Z4i/iACU1Lgu5E4iBOXBUXYEyeCv4t6eKQMN9vj/2AFRJQ6nBsVengZWd1ORoB/fyZW0CmR0sLmHO9l98Rmu81OE+FYzlsjkL2Vc8i8SskR+U1tJT27xR1C5L0uxhTgX1Dh3t+O7pQ9NWHKBwAg2Fy2/N/X8sieXohoke+CfeJnd+rqNtbqTT7VUspQxdVFj3RYYVpV3XnEGtQvsxciUENacDPxXmvR5p7LYKzCzhoW6Jr9I3sst8maTBFVxFvYe7x57dp83aQs+1nIDPw== yura@dev |
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
class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter | |
def table_exists?(name) | |
name = name.to_s | |
schema, table = name.split('.', 2) | |
unless table | |
table = schema | |
schema = nil | |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJsyeuMBzdVZzm83ni90Q16biMQD/xS4gJtkt89elbIERKerWZdPD1H0T+xM5IjM//0Hjelk8jagn8exEt3KaR8+KszwMPO6R0lEwSl6MsiKWwrVsUpO/wRT9x/xCTYz+QWsRP69s8N9HOpljfmJmCwfoJt32TuVt/rhevJrGvrDQgsQVSlU7ZUOrUCAWpxLiEEwMPUDkrWjl1f3HM3f6vUnYNUpxgEnLEcayfGK0zxT8sYNRmcKRmDHw4hb43gX/hRD3M20LkCN48fRUE2Lc0rQDE3oZfANuozENMaFfKqU4zGESMAT1PLi3LKshBv2S7Pj4DT6Vnh0WEOkG3eD4f yura@Yura-HP-Pavilion-DV7 |
NewerOlder