Skip to content

Instantly share code, notes, and snippets.

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)
@ryanb
ryanb / rails_3_1_rc4_changes.md
Created May 6, 2011 01:10
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]

@szimek
szimek / backbone_extensions.js
Created June 15, 2011 10:20
Extensions for Backbone.
// 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/)
@creationix
creationix / EventLoop.js
Created June 21, 2011 05:56
Userspace EventLoop for JavaScript
// 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 //
@bryckbost
bryckbost / gist:1040263
Created June 22, 2011 14:54
Capybara 1.0 and Chrome
# env.rb
Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(app, :browser => :chrome)
end
Download chromedriver from http://code.google.com/p/selenium/downloads/list
mv chromedriver to /usr/local/bin so it's in your path.
@tmpvar
tmpvar / .gitignore
Created July 12, 2011 07:19
A console.log implementation that plays "nice" with large amounts of data. It Keeps node alive until the output has flushed to the screen.
gmon.out
v8.log
@szimek
szimek / aspect.js
Created July 21, 2011 13:44
devmeetings.pl aspect js task implementation
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);
require "uri"
(URI::REGEXP.constants - ["PATTERN"]).each do |rc|
puts "#{rc}: #{URI::REGEXP.const_get(rc)}"
end
URI::REGEXP::PATTERN.constants.each do |pc|
puts "#{pc}: #{URI::REGEXP::PATTERN.const_get(pc)}"
end
@p01
p01 / LICENSE.txt
Last active May 23, 2024 13:46 — forked from 140bytes/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@alexaivars
alexaivars / setter_pattern.coffee
Created January 12, 2012 08:41
Getter Setter patter for Coffeescript
Function::define = (prop, desc) ->
Object.defineProperty this.prototype, prop, desc
class GetterSetterTest
constructor: (@_obj = {}) ->
# 'obj' is defined via the prototype, the definition proxied through
# to 'Object.defineProperty' via a function called 'define' providing
# some nice syntactic sugar. Remember, the value of '@' is
# GetterSetterTest itself when used in the body of it's class definition.