As configured in my dotfiles.
start new:
tmux
start new with session name:
| =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') |
| /* | |
| Load Sinon.JS in the SpecRunner: | |
| <script type="text/javascript" src="lib/jasmine-1.0.1/jasmine.js"></script> | |
| <script type="text/javascript" src="lib/jasmine-1.0.1/jasmine-html.js"></script> | |
| <script type="text/javascript" src="sinon-1.0.0.js"></script> | |
| <script type="text/javascript" src="sinon-ie-1.0.0.js"></script> | |
| http://cjohansen.no/sinon/ | |
| */ |
| // (c) copyright unscriptable.com / John Hann | |
| // License MIT | |
| // For more robust promises, see https://github.com/briancavalier/when.js. | |
| function Promise () { | |
| this._thens = []; | |
| } | |
| Promise.prototype = { |
| var content = ''; | |
| var boundary = '---------------------------170062046428149'; | |
| content += '--'+ boundary + '\r\n'; | |
| content += 'Content-Disposition: form-data; name="uploadToken"\r\n'; | |
| content += '\r\n'; | |
| content += upload_token + '\r\n'; | |
| content += '--'+ boundary + '\r\n'; | |
| content += 'Content-Disposition: form-data; name="destFolderPath"\r\n'; | |
| content += '\r\n'; |
| ## Prepare ################################################################### | |
| # Remove RVM | |
| rvm implode | |
| # Ensure your homebrew is working properly and up to date | |
| brew doctor | |
| brew update | |
| ## Install ################################################################### |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| # encoding: utf-8 | |
| # app/controllers/application_controller.rb | |
| # author: Boris Barroso | |
| # email: [email protected] | |
| class ApplicationController < ActionController::Base | |
| layout lambda{ |c| | |
| if (c.request.xhr? or params[:xhr]) | |
| false | |
| elsif params[:print].present? | |
| "print" |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.| <h2>Sign up</h2> | |
| <div id="stripe_error" class="alert alert-error" style="display:none" > | |
| </div> | |
| <%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => {:class => 'card_form form-vertical' }) do |f| %> | |
| <h3><%= params[:plan].titleize if params[:plan] %> Subscription Plan</h3> | |
| <%= hidden_field_tag 'plan', params[:plan] %> | |
| <%= f.error_notification %> | |
| <%= f.input :f_name, :autofocus => true %> | |
| <%= f.input :l_name %> | |
| <%= f.input :email, :required => true %> |