Skip to content

Instantly share code, notes, and snippets.

(function($) {
jqUnit.Spec = function(name) {
this.before = false;
this.after = false;
this.assigns = {};
jqUnit.module(name);
};
$.extend(jqUnit.Spec.prototype, {
var MyObject = {
attribute1: 'test',
attribute2: function() {
return this.attribute1;
}
};
MyObject.attribute1 #=> 'test'
MyObject.attribute2 #=> function()
MyObject.attribute2() #=> 'test'
@quirkey
quirkey / irb
Created April 22, 2009 12:43 — forked from bmizerany/irb
[08:48 AM:gist-99771(master)] $ irb -rubygems -r myapp.rb -r rack/test
>> app = Rack::Test::Session.new(Sinatra::Application)
=> #<Rack::Test::Session:0x17e8820 @headers={}, @app=Sinatra::Application>
>> app.get '/'
=> #<Rack::Response:0x17ad4dc @block=nil, @writer=#<Proc:0x0189f7b4@/opt/local/lib/ruby/gems/1.8/gems/rack-0.9.1/lib/rack/response.rb:24>, header{"Content-Type"=>"text/html", "Content-Length"=>"7"}, body["testing"], length7, status200
>> app.body
NoMethodError: undefined method `body' for #<Rack::Test::Session:0x17e8820>
from (irb):3
@quirkey
quirkey / way 1.js
Created April 26, 2009 20:26 — forked from mrb/gist:102144
var Favorite = {
client_name: "",
client_id: "",
user_id: "",
add_or_remove: "",
getID: function(params){
this.client_name = params.attr("client_name");
this.client_id = params.attr("client_id");
this.user_id = params.attr("user_id");
(function($) {
$("#assign_pub_to_trans").click(function(){
$(this).removeClass("unselected").addClass("selected").val("1");
$("#assign_age_to_trans").removeClass("selected").addClass("unselected").val("0");
});
$("#assign_age_to_trans").click(function(){
$(this).removeClass("unselected").addClass("selected").val("1");
$("#assign_pub_to_trans").removeClass("selected").addClass("unselected").val("0");
# jsdoc.rb (by quirkey/Aaron Quint)
#
# Simple Documentation generator for JavaScript Class files.
#
# usage :
# ruby jsdoc.rb FILE
#
# looks for files formatted like
#
# MyClass = Class.extend({
# in test_helper
def mock_fetch(data)
curb_response = mock
curb_response.expects(:body_str).returns(data)
Curl::Easy.expects(:perform).returns(curb_response)
end
require 'autotest/redgreen'
require 'autotest/growl'
Autotest.add_hook :run do |autotest|
autotest.add_exception(/^\.\/vendor/)
autotest.add_exception(/\.svn/)
end
var ob = {
sleep: function(howlong, sig) {
for(i=0; i < howlong; i++) {
console.log(sig, howlong)
}
}
}
ob.sleep(10, 'first');
ob.sleep(2, 'second');
[04:58 PM:swinger(master)] $ couchapp push
[INFO] Pushing CouchApp in /Users/aaronquint/Sites/__active/swinger to design doc:
http://localhost:5984/swinger/_design/swinger
[INFO] Visit your CouchApp here:
http://localhost:5984/swinger/_design/swinger/index.html
Traceback (most recent call last):
File "/usr/local/bin/couchapp", line 8, in <module>
load_entry_point('Couchapp==0.3.31', 'console_scripts', 'couchapp')()
File "/Users/aaronquint/Sites/__forked/couchapp/src/couchapp/bin/couchapp_cli.py", line 196, in main
cli.push(appdir, appname, dbstring, options=options)