Backbone.js on Rails @ #rcne2011
Nick Gauthier's presentation from Baltimore.rb
| # cucumber supports selenium by default, just mark features with @selenium tag | |
| @selenium | |
| Feature: This feature will be executed with selenium | |
| ... |
| =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_or_button('Link Text') # Click either a link or a button | |
| click('Button Value') |
| " | |
| " While editing a Markdown document in Vim, preview it in the | |
| " default browser. | |
| " | |
| " Author: Nate Silva | |
| " | |
| " To install: Place markdown.vim in ~/.vim/ftplugin or | |
| " %USERPROFILE%\vimfiles\ftplugin. | |
| " | |
| " To use: While editing a Markdown file, press ',p' (comma p) |
| diff --git a/array.c b/array.c | |
| index b1616c5..16326fc 100644 | |
| --- a/array.c | |
| +++ b/array.c | |
| @@ -302,7 +302,7 @@ ary_alloc(VALUE klass) | |
| return (VALUE)ary; | |
| } | |
| -static VALUE | |
| +VALUE |
| 1) backup production database: | |
| heroku pgbackups:capture --expire --remote production | |
| 2) obtain url string to backup from step 1: | |
| heroku pgbackups:url --app production_app_name --remote production_app_branch_name | |
| 3) transfer backup from production to staging app: | |
| heroku pgbackups:restore DATABASE 'production_app_backup_url_string_from_step_2' --app production_app_name --app staging_app_branch_name |
Backbone.js on Rails @ #rcne2011
Nick Gauthier's presentation from Baltimore.rb
| # Dependencies: pdftotext (included in xpdf) | |
| # OSX: brew install xpdf | |
| # Ubuntu/Debian: apt-get install xpdf | |
| Then /^I should have get a pdf with the business name$/ do | |
| page.response_headers['Content-Type'].should include 'application/pdf' | |
| pdf_to_text.should include @current_business.name | |
| end | |
| def pdf_to_text |
| def pending_notifications | |
| notifications = self.notifications | |
| if last_notification_read_at | |
| # Sqlite doesn't properly compare dates because doesn't have a dedicated | |
| # type for it. | |
| # TODO: Investigate further and find a better solution for this. | |
| # | |
| time_restriction = if connection.class.name.demodulize =~ /SQLite/ |
| # see http://stackoverflow.com/questions/5880962/how-to-destroy-jobs-enqueued-by-resque-workers - old version | |
| # see https://github.com/defunkt/resque/issues/49 | |
| # see http://redis.io/commands - new commands | |
| namespace :resque do | |
| desc "Clear pending tasks" | |
| task :clear => :environment do | |
| queues = Resque.queues | |
| queues.each do |queue_name| | |
| puts "Clearing #{queue_name}..." |
| #!/usr/bin/env ruby | |
| # List all keys stored in memcache. | |
| # Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place. | |
| require 'net/telnet' | |
| headings = %w(id expires bytes cache_key) | |
| rows = [] |