Skip to content

Instantly share code, notes, and snippets.

View mbriggs's full-sized avatar

Matt Briggs mbriggs

View GitHub Profile
# given this code
def foo
a = 1
b = 2
unless false
a = 2
b = 3
end
# given this code
def foo
a = 1
b = 2
unless false
a = 2
b = 3
end
// unbind all bindings for a given object
unbindAllEventsFor: function(obj){
var binder = this;
_(this._eventBindings).chain().
filter(function(binding){
return binding.obj === obj;
}).
each(function(binding){
binder.unbindFrom(binding);
module ActionView #:nodoc:
module Helpers #:nodoc:
extend ActiveSupport::Autoload
autoload :ActiveModelHelper
autoload :AssetTagHelper
autoload :AtomFeedHelper
autoload :BenchmarkHelper
autoload :CacheHelper
autoload :CaptureHelper
source :gemcutter
# we normally only list top-level dependencies in this file
gem "activerecord-import", "~> 0.2.0"
gem 'activerecord-postgres-hstore'
gem "acts_as_list", "~> 0.1.4"
gem "authorization-rails", "~> 1.0.12", :require => "authorization"
gem 'awesome_print', :require => 'ap'
gem 'nulogy-authlogic', '~>3.1', :require => 'authlogic'
gem 'autocomplete_for', '~> 0.2.4'
/*
* Currently (as I understand it), BBCloneMail is organized as a hierarchy of modules,
* where all modules communicate via req/resp, or commands, and all internals are implementation
* details.
*
* for the purposes of conversation, I am calling modules that are conceptually bodies of code as
* "sub applications", and modules that interact in those bodies of code as "modules"
*/
// psudo-code
/* global Underscore jQuery console */
;(function($){
// this is required to solve virtually any problem
var logAllTheThings = false;
function log(){
if(console && logAllTheThings) console.log.apply(console, arguments);
}
/* global Underscore jQuery console */
;(function($){
// this is required to solve virtually any problem
var logAllTheThings = false;
function log(){
if(console && logAllTheThings) console.log.apply(console, arguments);
}
(defun semi-colonize ()
(interactive)
(beginning-of-buffer)
(query-replace-regexp "^ *[^/]+[^;,{}\n.]$" "\\&;"))
require 'mongo'
require 'nokogiri'
require 'pg'
task 'qcloud:migrate:standards' do
mongo_conn = Mongo::Connection.new.db("qcloud")
pg_conn = PG.connect(dbname: "qcloud_dev", host: 'localhost')
standards_collection = mongo_conn["standards"]
sheets_collection = mongo_conn["sheets"]