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
`git branch -a`.split("\n")[2..-1].map { |name| name = name.gsub("remotes\/origin\/", "").strip; `git checkout -b #{name} origin/#{name}` } |
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
grep "should_have_many" spec/* -Ril | xargs sed -i "s/should_have_many\(.*\)/it { should have_many\1 }/g" | |
grep "should_have_one" spec/* -Ril | xargs sed -i "s/should_have_one\(.*\)/it { should have_one\1 }/g" | |
grep "should_belong_to" spec/* -Ril | xargs sed -i "s/should_belong_to\(.*\)/it { should belong_to\1 }/g" | |
grep "should_validate_presence_of.*" spec/* -Ril | xargs sed -i "s/should_validate_presence_of\(.*\)/it { should validate_presence_of\1 }/g" | |
grep "should_validate_uniqueness_of.*" spec/* -Ril | xargs sed -i "s/should_validate_uniqueness_of\(.*\)/it { should validate_uniqueness_of\1 }/g" | |
grep "should_validate_numericality_of.*" spec/* -Ril | xargs sed -i "s/should_validate_numericality_of\(.*\)/it { should validate_numericality_of\1 }/g" | |
grep "should_validate_acceptance_of.*" spec/* -Ril | xargs sed -i "s/should_validate_acceptance_of\(.*\)/it { should validate_acceptance_of\1 }/g" | |
grep "should have_many :.*through.*" spec/* -Ril | xargs sed -i 's/should have_many :\([a-z_=>]*\),.*:through => :\(.*\) |
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
group :development, :test do | |
gem 'rspec-rails', '~> 2.9' # rails generate rspec:install | |
gem 'factory_girl_rails' | |
end | |
group :test do | |
gem 'spork-rails' # spork rspec --bootstrap | |
gem 'capybara' | |
gem 'launchy' | |
gem 'timecop' |
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 'grit' | |
require 'fileutils' | |
# Define our paths. | |
# We're gonna have 3 paths: one original, one for the fork, and yet another one for the merge | |
root_path = "#{File.dirname(__FILE__)}/documents" | |
original_path = "#{root_path}/original_repo.git" | |
fork_path = "#{root_path}/fork_repo.git" | |
merge_path = "#{root_path}/merge_repo" |
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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
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 | |
### BEGIN INIT INFO | |
# Provides: unicorn | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the unicorn web server | |
# Description: starts unicorn |
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
# MySQL. Versions 4.1 and 5.0 are recommended. | |
# | |
# Install the MySQL driver: | |
# gem install mysql2 | |
# | |
# And be sure to use new-style password hashing: | |
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
development: | |
adapter: mysql2 | |
encoding: utf8 |
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
Started GET "/taurus" for 193.138.246.138 at 2011-12-09 16:36:50 +0000 | |
Processing by ServiceProvidersController#show as HTML | |
Parameters: {"id"=>"taurus"} | |
Rendered shared/_social_bar.html.erb (0.1ms) | |
Rendered /home/styleup/StyleUp/shared/bundle/ruby/1.9.1/gems/gmaps4rails-1.3.2/app/views/gmaps4rails/_gmaps4rails.html.erb (0.8ms) | |
Rendered service_providers/_service_item.html.erb (0.2ms) | |
Rendered service_providers/_service_type_item.html.erb (2.7ms) | |
Rendered service_providers/_service_type_item.html.erb (0.4ms) | |
Rendered service_providers/show.html.erb within layouts/application (35.1ms) | |
Completed 500 Internal Server Error in 44ms |
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
sudo -u USERNAME -H sh -c "string" |
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
sudo aptitude install git-core curl gcc checkinstall libxml2-dev libxslt-dev sqlite3 libsqlite3-dev libcurl4-openssl-dev libreadline5-dev libc6-dev libssl-dev libmysql++-dev make build-essential zlib1g-dev | |
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz | |
tar xfvz ruby-1.9.2-p290.tar.gz | |
cd ruby-1.9.2-p290 | |
./configure | |
make | |
sudo checkinstall -D |