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 addScript(url) { | |
var script = document.createElement('script'); | |
script.src = url; | |
document.getElementsByTagName('head')[0].appendChild(script); | |
} | |
or | |
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
script/generate cucumber :setup cucumber in your app | |
cucumber features -n :test against /features | |
script/generate rspec_model Article title:string content:text | |
..generate rspec model + db migrations | |
rake db:migrate :migrate database | |
rake db:test:clone :clone migrations to test database | |
script/generate rspec_controller articles index |
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
script/generate integration_test authentication | |
..generate integration test 'authentication' | |
rake test:integration :run integration tests |
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
add to: config/environments/test.rb | |
config.gem "rspec", :lib => false, :version => '>=1.2.2' | |
config.gem "rspec-rails", :lib => false, :version => '>=1.2.2' | |
config.gem "webrat", :lib => false, :version => ">=0.4.3" | |
config.gem "cucumber", :lib => false, :version => '>=0.2.2' | |
sudo rake gems:install :install gems | |
sudo rake gems:install RAILS_ENV=test :install gems for [test] env | |
sudo rake gems:build :build gems needing native extensions |
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
export PATH=${PATH}:/opt/local/bin | |
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# don't put duplicate lines in the history. See bash(1) for more options |
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
branching how-to | |
---------------- | |
1. grab the master | |
git clone git@github.com:indiehead/matilda.git | |
2. go into the master | |
cd matilda | |
3. create your branch |
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
rake rails:freeze:edge RELEASE=2.3.2 |
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
if Rails.version ~= /^2.3/ | |
0 | |
+ app_filename = "#{RAILS_ROOT}/app/controllers/application_controller.rb" | |
0 | |
+ else | |
0 | |
+ app_filename = "#{RAILS_ROOT}/app/controllers/application.rb" | |
0 | |
+ 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
Absolute must-do for any new git users out there: set your name and email, so people can know who did what in the code! | |
git config --global user.name "John Doe" | |
git config --global user.email "john.doe@company.com" | |
Also, if you’re a command-line user (and who isn’t?!), make sure you configure it to add a splash of colour to its output. It’s really useful. | |
git config --global color.diff auto | |
git config --global color.status auto | |
git config --global color.branch auto |
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
GRANT ALL PRIVILEGES ON `testdb\_%` . * TO 'test'@'localhost'; | |
SHOW GRANTS FOR 'test'@'localhost'; |