As configured in my dotfiles.
start new:
tmux
start new with session name:
| # mongo_template.rb | |
| # fork of Ben Scofield's Rails MongoMapper Template (http://gist.github.com/181842) | |
| # | |
| # To use: | |
| # rails project_name -m http://gist.github.com/gists/219223.txt | |
| # remove unneeded defaults | |
| run "rm public/index.html" | |
| run "rm public/images/rails.png" | |
| run "rm public/javascripts/controls.js" |
| /** | |
| * truncatable - jQuery lightweight text truncation plugin | |
| * | |
| * Adapted from Philip Beel's code http://theodin.co.uk/blog/development/truncatable-jquery-plugin.html | |
| * | |
| * Copyright (c) 2010 Nicolas Perriault (http://prendreuncafe.com/blog/) | |
| * Copyright (c) 2009 Philip Beel (http://www.theodin.co.uk/) | |
| * | |
| * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) | |
| * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. |
| =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') |
| webfont.DomHelper.prototype.setCssStyle = function(styleNode, body) { | |
| if (styleNode.styleSheet) { | |
| styleNode.styleSheet.cssText = body; | |
| } else { | |
| styleNode.appendChild(this.document_.createTextNode(body)); | |
| } | |
| return styleNode; | |
| } | |
| /** |
| require 'rubygems' | |
| require 'mongo' | |
| module MongoPubSub | |
| QUEUES_COLLECTION = 'queues' | |
| class EndSubscriptionException < Exception; end | |
| class Publisher | |
| def initialize(queue_name, mongo_connection) | |
| # Initialize queue collection as a capped collection | |
| if not mongo_connection[QUEUES_COLLECTION].collection_names.include?(queue_name) |
| //******************************************* | |
| // Level 1, basic API, minimum support | |
| //******************************************* | |
| /* | |
| Modules IDs are strings that follow CommonJS | |
| module names. | |
| */ | |
| //To load code at the top level JS file, | |
| //or inside a module to dynamically fetch |
| require 'sinatra' | |
| # Set the version of the API being run here | |
| # | |
| MAJOR_VERSION = 1 | |
| MINOR_VERSION = 0 | |
| VERSION_REGEX = %r{/api/v(\d)\.(\d)} | |
| helpers do | |
| def version_compatible?(nums) |
| class Avatar < ActiveRecord::Base | |
| attr_accessor :content_type, :original_filename, :image_data | |
| before_save :decode_base64_image | |
| has_attached_file :image, | |
| PAPERCLIP_CONFIG.merge( | |
| :styles => { | |
| :thumb => '32x32#', | |
| :medium => '64x64#', |
| // Source: http://www.golimojo.com/etc/js-subclass.html | |
| function subclass(constructor, superConstructor) | |
| { | |
| function surrogateConstructor() | |
| { | |
| } | |
| surrogateConstructor.prototype = superConstructor.prototype; |
As configured in my dotfiles.
start new:
tmux
start new with session name: