This file contains hidden or 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 | |
| gem 'better_errors' # better errors pages (https://github.com/charliesome/better_errors) | |
| gem 'binding_of_caller' # console for better errors | |
| gem 'jazz_hands' # cool rails console `rails c` (https://github.com/nixme/jazz_hands) | |
| gem 'quiet_assets' # speed up assets & clear log (https://github.com/evrone/quiet_assets) | |
| gem 'bullet' # optimize queries (https://github.com/flyerhzm/bullet) | |
| end |
This file contains hidden or 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 'rubygems' | |
| require 'nokogiri' | |
| require 'fileutils' | |
| require 'date' | |
| require 'uri' | |
| # usage: ruby import.rb my-blog.xml | |
| # my-blog.xml is a file from Settings -> Basic -> Export in blogger. | |
| data = File.read ARGV[0] |
This file contains hidden or 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
| generators = [] | |
| puts 'Spinning up a new app, captain!' | |
| devise = yes?('Use Devise? (yes/no)') | |
| jquery = yes?('Use jQuery? (yes/no)') | |
| jquery_ui = yes?('Use jQuery UI? (yes/no)') if jquery | |
| mongoid = yes?('Use mongoid? (yes/no)') | |
| haml = yes?('Use haml? (yes/no)') | |
| rspec = yes?('Use Rspec? (yes/no)') |
This file contains hidden or 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 | |
| set_path="cd /home/josh/current" | |
| case "$1" in | |
| start) | |
| echo -n "Starting delayed_job: " | |
| su - root -c "$set_path; RAILS_ENV=production script/delayed_job start" >> /var/log/delayed_job.log 2>&1 | |
| echo "done." | |
| ;; | |
| stop) |
This file contains hidden or 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
| check process nginx with pidfile /opt/nginx/logs/nginx.pid | |
| start program = "/opt/nginx/sbin/nginx" | |
| stop program = "/opt/nginx/sbin/nginx -s stop" | |
| if cpu is greater than 70% for 3 cycles then alert | |
| if cpu > 80% for 5 cycles then restart | |
| if 10 restarts within 10 cycles then timeout | |
| check process sphinx with pidfile /home/josh/shared/pids/searchd.pid | |
| stop program = "/bin/bash -c 'cd /home/josh/current && /usr/bin/rake RAILS_ENV=production ts:stop'" | |
| start program = "/bin/bash -c 'cd /home/josh/current && /usr/bin/rake RAILS_ENV=production ts:start'" |
This file contains hidden or 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
| generators = [] | |
| puts 'Spinning up a new app, captain!' | |
| devise = yes?('Use Devise? (yes/no)') | |
| jquery = yes?('Use jQuery? (yes/no)') | |
| jquery_ui = yes?('Use jQuery UI? (yes/no)') if jquery | |
| mongoid = yes?('Use mongoid? (yes/no)') | |
| haml = yes?('Use haml? (yes/no)') | |
| rspec = yes?('Use Rspec? (yes/no)') |
This file contains hidden or 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
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |