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
| class InvitationsController < ApplicationController | |
| before_filter :user_required | |
| before_filter :account_required, :only => [:new, :create] | |
| def new | |
| @invitation = Invitation.new | |
| end | |
| def create |
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
| for (i = 0; i < 261; i++) { window.setTimeout(function() { $('input[id=control_answer_primary_answer_na]').attr('checked', 'checked'); $('form').trigger('submit'); }, 300); } |
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
| # config.ru | |
| use Rails::Offline, {} do | |
| public_path = Pathname.new(Rails.public_path) | |
| Dir[public_path.join("javascripts/*.js")].each do |file| | |
| cache Pathname.new(file).relative_path_from(public_path) | |
| end | |
| network "/" | |
| 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
| <html> | |
| <head> | |
| <meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
| <title>Backbone examples for model data binding</title> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> | |
| <script src="scripts/underscore.js" type="text/javascript" charset="utf-8"></script> | |
| <script src="scripts/backbone.js" type="text/javascript" charset="utf-8"></script> | |
| <script src="scripts/backbone.modelbinding.js" type="text/javascript" charset="utf-8"></script> | |
| <script src="scripts/application.js" type="text/javascript" charset="utf-8"></script> |
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
| var Post = Backbone.Model.extend(); | |
| var Views = { | |
| Posts: {} | |
| }; | |
| var post = new Post({ | |
| select: 'image', | |
| radio: 'video', | |
| text: 'title', |
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
| var Mutex = function() { | |
| this.queues = []; | |
| this.locked = false; | |
| }; | |
| Mutex.prototype = { | |
| push: function(callback) { | |
| var self = this; | |
| this.queues.push(callback); | |
| if (!this.locked) { |
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
| Capybara.default_host = "lvh.me" | |
| Capybara.app_host = "http://lvh.me:3003" | |
| Capybara.server_port = 3003 | |
| Before('@html5') do | |
| if [:webkit, :webkit_debug].include? Capybara.current_driver | |
| page.driver.browser.set_attribute("LocalStorageEnabled") | |
| # Single localStorage per scenario by generating subdomain | |
| part = (1000 * rand()).to_i.to_s |
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
| (function(global) { | |
| if (_.isUndefined(global.localStorage)) { | |
| global.localStorage = { | |
| data: {}, | |
| getItem: function(key) { | |
| return this.data[key] || null; | |
| }, | |
| setItem: function(key, value) { |
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
| cd /usr/local/Cellar/macvim/7.3-64/MacVim.app/Contents/Resources/vim/runtime/ftplugin | |
| mv ruby.vim ruby.vim.bac | |
| wget https://raw.github.com/vim-ruby/vim-ruby/master/ftplugin/ruby.vim |
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
| // | |
| // Example 1: | |
| // function getData(success) { | |
| // $.get('/data', success); | |
| // }; | |
| // | |
| // var timer = new Timer(getData); | |
| // timer.start(); | |
| // | |
| // Example 2: |