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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
| <title>Auctions Test</title> | |
| <script type="text/javascript" charset="utf-8" src="node_modules/faye/faye-browser.js"></script> | |
| <script type="text/javascript" charset="utf-8" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.js"></script> | |
| <script type="text/javascript" charset="utf-8"> | |
| bayeux_client = new Faye.Client('http://localhost:8000/auctions'); |
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 http = require('http'), | |
| faye = require('faye'); | |
| var bayeux = new faye.NodeAdapter({ | |
| mount: '/auctions', | |
| timeout: 45 | |
| }); | |
| // Handle non-Bayeux requests | |
| var server = http.createServer(function(request, response) { |
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 'benchmark' | |
| Benchmark.bm do |x| | |
| x.report("concatenation") do | |
| for i in 0..30000000 do | |
| str = "a=" << "10" << ",b=" << "20" << ",c=" << "30" << "." | |
| end | |
| end | |
| x.report("interpolation") do |
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 'benchmark' | |
| def a_method | |
| 10 | |
| end | |
| a_var = 10 | |
| Benchmark.bm do |x| | |
| x.report("variable access") do | |
| for i in 0..200000000 do |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
| <title>Auctions Test</title> | |
| <script type="text/javascript" charset="utf-8" src="node_modules/faye/faye-browser.js"></script> | |
| <script type="text/javascript" charset="utf-8" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.js"></script> | |
| <script type="text/javascript" charset="utf-8"> | |
| bayeux_client = new Faye.Client('http://localhost:8000/auctions'); |
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 'spec_helper' | |
| describe 'rspec' do | |
| it { true.should be_true } | |
| it "mock methods" do | |
| my_obj = double('obj', {:my_method => 2}) | |
| my_obj.send('my_method').should == 2 | |
| end | |
| it "mock hyphen methods" do |
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
| POST /api/journals.json?authentication_token=RW6XUuI7hP0EnB4hZa0cjcsXLHkW1RhfXThhaKpen2nicMAsteU8gt1EgMoz HTTP/1.1 | |
| Host: localhost:3000 | |
| User-Agent: upage 0.8 (iPad Simulator; iPhone OS 4.3; en_US) | |
| Content-Type: application/json;charset=utf-8;charset=utf-8 | |
| Accept-Encoding: gzip | |
| Accept: */* | |
| Content-Length: 207 | |
| Cookie: _upage-web_session=BAh7CEkiGXdhcmRlbi51c2VyLnVzZXIua2V5BjoGRVRbCEkiCVVzZXIGOwBGWwZpBkkiIiQyYSQxMCRzNnJxbkJaVFFvSDNIaTdNMEw5Mkp1BjsAVEkiHXdhcmRlbi51c2VyLnVzZXIuc2Vzc2lvbgY7AFR7BkkiFGxhc3RfcmVxdWVzdF9hdAY7AEZJdToJVGltZQ2rzhvAPaKZQAY6C0Bfem9uZSIIVVRDSSIPc2Vzc2lvbl9pZAY7AEYiJTIzYWNiMmU0NGM2NTYyNzcyNzlhZDdmNjgzNTYyNjlj--4ec972c052e55126acc68df354a0409b0142b2c6 | |
| Connection: keep-alive |
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
| mike@rbci:~$ psql -U postgres | |
| psql (9.0.3) | |
| Type "help" for help. | |
| postgres=# update pg_database set datallowconn = TRUE where datname = 'template0'; | |
| UPDATE 1 | |
| postgres=# \c template0 | |
| You are now connected to database "template0". | |
| template0=# update pg_database set datistemplate = FALSE where datname = 'template1'; | |
| UPDATE 1 |
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
| def destroy | |
| @journal = current_user.journals.find(params[:id]) | |
| begin | |
| Page.skip_callback(:save, :after, :run_rendering) | |
| Page.skip_callback(:destroy, :before, :remove_from_list) | |
| @journal.destroy | |
| ensure | |
| Page.set_callback(:save, :after, :run_rendering) | |
| Page.set_callback(:destroy, :before, :remove_from_list) | |
| 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
| <script> | |
| function A() { | |
| alert("new A called"); | |
| this.my_method = function(element) { | |
| alert("a#method called"); | |
| } | |
| }; | |
| A.initialize = function() { | |
| alert ("A#initialize called"); |