This file contains hidden or 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($) { | |
| jqUnit.Spec = function(name) { | |
| this.before = false; | |
| this.after = false; | |
| this.assigns = {}; | |
| jqUnit.module(name); | |
| }; | |
| $.extend(jqUnit.Spec.prototype, { |
This file contains hidden or 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 MyObject = { | |
| attribute1: 'test', | |
| attribute2: function() { | |
| return this.attribute1; | |
| } | |
| }; | |
| MyObject.attribute1 #=> 'test' | |
| MyObject.attribute2 #=> function() | |
| MyObject.attribute2() #=> 'test' |
This file contains hidden or 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
| [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 |
This file contains hidden or 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 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"); |
This file contains hidden or 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($) { | |
| $("#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"); |
This file contains hidden or 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
| # 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({ |
This file contains hidden or 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
| # 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 |
This file contains hidden or 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 'autotest/redgreen' | |
| require 'autotest/growl' | |
| Autotest.add_hook :run do |autotest| | |
| autotest.add_exception(/^\.\/vendor/) | |
| autotest.add_exception(/\.svn/) | |
| end |
This file contains hidden or 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 ob = { | |
| sleep: function(howlong, sig) { | |
| for(i=0; i < howlong; i++) { | |
| console.log(sig, howlong) | |
| } | |
| } | |
| } | |
| ob.sleep(10, 'first'); | |
| ob.sleep(2, 'second'); |
This file contains hidden or 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
| [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) |