[color] branch = auto diff = auto status = auto [color "branch"] current = yellow reverse local = yellow remote = green [color "diff"]
This file contains 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> | |
<script src="jquery-1.6.1.min.js"></script> | |
<script src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script> | |
<script src="underscore-min.js"></script> | |
<script src="backbone-min.js"></script> | |
<script src="example.js"></script> | |
<style type="text/css"> | |
fieldset { |
This file contains 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
# src_files | |
# | |
# Return an array of filepaths relative to src_dir to include before jasmine specs. | |
# Default: [] | |
# | |
# EXAMPLE: | |
# | |
# src_files: | |
# - lib/source1.js | |
# - lib/source2.js |
This file contains 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 'eventmachine' | |
children = [] | |
Signal.trap('SIGINT') do | |
EventMachine.next_tick { EventMachine.stop_event_loop } | |
end | |
Signal.trap('EXIT') do |
This file contains 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 'thread' | |
module EventMachine | |
module Test | |
module Utils | |
module Cranking | |
# Stolen from MenTaLguYs Omnibus | |
class Waiter | |
def initialize |
This file contains 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 SomeMiddleware | |
def initialize(app) @app = app end | |
def call(env) | |
background(env) { ... } | |
@app.call env | |
end | |
def background(env, &block) | |
if env['rack.run_once'] then yield |
This file contains 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 'logger' | |
require 'openssl' | |
class UcellGateway | |
#dunno what this is, but it's yours :) | |
include MessageFilter | |
def initialize | |
@logger = Logger.new |
This file contains 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 'sinatra' | |
require 'eventmachine' | |
class EventStream | |
include EventMachine::Deferrable | |
def initialize(channel, &block) | |
@channel = channel | |
@block = block |
This file contains 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 () { | |
Backbone.syncWithoutUpload = Backbone.sync | |
Backbone.syncWithUpload = function(method, model, options) { | |
// Create iframe | |
var iframe_id = 'file_upload_iframe_' + Date.now() | |
, iframe = jQuery('<iframe id="' + iframe_id + '" name="' + iframe_id + '" ></iframe>').hide() | |
// Create an hidden form | |
var authToken = jQuery('meta[name=csrf-token]').attr('content') | |
, authParam = jQuery('meta[name=csrf-param]').attr('content') |
This file contains 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
// includes bindings for fetching/fetched | |
var PaginatedCollection = Backbone.Collection.extend({ | |
initialize: function() { | |
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage'); | |
typeof(options) != 'undefined' || (options = {}); | |
this.page = 1; | |
typeof(this.perPage) != 'undefined' || (this.perPage = 10); | |
}, | |
fetch: function(options) { |