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
Day 1 | |
Julian Cheal | |
Dancing with Robots | |
? | |
Tero Parviainen | |
Build Your Own AngularJS | |
? |
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
gemcutter => redis downloads spec | |
================================= | |
keys | |
---- | |
downloads => global counter for all gem downloads | |
downloads:today => sorted set for downloads from today | |
downloads:rubygem:rails => counter for all rails downloads | |
downloads:version:rails-2.3.5 => counter for all rails 2.3.5 downloads |
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
Devise::ALL.dup.each do |name| | |
class_name = name.to_s.classify | |
to_class = WebsiteAccount | |
to_instance = :website_account | |
class_eval <<-METHODS, __FILE__, __LINE__ + 1 | |
module Devise::Models::Delegated#{class_name} | |
extend ActiveSupport::Concern | |
included 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
# adapted from rspec-rails http://github.com/rspec/rspec-rails/blob/master/spec/rspec/rails/mocks/mock_model_spec.rb | |
shared_examples_for "ActiveModel" do | |
require 'test/unit/assertions' | |
require 'active_model/lint' | |
include Test::Unit::Assertions | |
include ActiveModel::Lint::Tests | |
# to_s is to support ruby-1.9 | |
ActiveModel::Lint::Tests.public_instance_methods.map{|m| m.to_s}.grep(/^test/).each do |m| |
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
#! /usr/bin/env ruby | |
status = DATA.flock(File::LOCK_EX | File::LOCK_NB) | |
if status == 0 | |
puts "we have the lock..." | |
sleep | |
else |
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
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" ]; then cat <<EOF | |
Multi-Firefox Fixer - v0.2 - 4/26/2011 | |
http://benalman.com/ | |
Usage: `basename "$0"` | |
Run this shell script from beside (in the same parent directory as) one or more | |
Firefox*.app or Aurora*.app applications and it will "fix" those Firefoxes to |
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
module Test | |
module Unit | |
TestCase = RSpec::Core::ExampleGroup | |
end | |
end | |
class Test::Unit::TestCase | |
def self.inherited(host) | |
host.set_it_up host.name.gsub(/(Spec|Test)/,'') | |
def host.method_added(name) |
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
// TODO: | |
// - TemplateView | |
// - change the way templates are compiled (store compiled version inside view "class"?) | |
// | |
// - CollectionView | |
// - cleanup layout rendering if it depends on collection (remove collection container from DOM, rerender the layout and attach it again?) | |
// - store model views together with models (?) | |
// | |
// - ModelView | |
// - extend Model#toJSON to convert nested objects as well (http://rcos.rpi.edu/projects/concert/commit/got-requests-displaying-properly-again/) |
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
// Make a user-space event loop for doing smart event propigation with zero* | |
// race conditions. | |
// | |
// *(If you are unable to get at the event-source, an automatic setTimeout will | |
// be created, and there is a small chance some other native event may get in | |
// before it.) | |
function makeLoop() { | |
// Private // |
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
var aspect = {}; | |
aspect.add = function (obj, fnName, aspectFn, when, once) { | |
if ('object' !== typeof obj) throw new TypeError('Must pass an object as the first argument'); | |
obj = obj || window; | |
if (Array.isArray(fnName)) { | |
fnName.forEach(function (name) { | |
aspect._add(obj, name, aspectFn, when, once); |
OlderNewer