Skip to content

Instantly share code, notes, and snippets.

View acidlabs-snippets's full-sized avatar

acidlabs-snippets

View GitHub Profile
@acidlabs-snippets
acidlabs-snippets / pre-commit
Created October 3, 2012 18:42
#GIT #Hook #tests
#!/usr/bin/env ruby
#
tests = [
{:name => "RSPEC", :command => "rake spec"},
{:name => "JASMINE", :command => "jasmine-headless-webkit --color"}
]
tests.each do |test|
puts "\e[33mEXECUTING #{test[:name]} TESTS\e[0m"
test[:result] = system test[:command]
@acidlabs-snippets
acidlabs-snippets / app.conf
Created October 1, 2012 14:21
nginx config for thin #server #nginx #thin
upstream app_name {
server 127.0.0.1:4000; #port examples
server 127.0.0.1:4001;
}
server {
server_name example.com;
listen 80;
access_log <acces_log_path>;
error_log <error_log_path;
@acidlabs-snippets
acidlabs-snippets / gist:3802268
Created September 28, 2012 21:52
Migration Functions #rails #migration #db
def change
add_column :table_name, :column_name, :column_type, default: 'default value'
remove_column :table_name, :column_name
rename_column :table_name, :old_name, :new_name
change_column :table_name, :column_name, :column_type
end