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
| ######################################### | |
| # Very basic rack application showing how to use a router based on the uri | |
| # and how to process requests based on the HTTP method used. | |
| # | |
| # Usage: | |
| # $ rackup rack_example.ru | |
| # | |
| # $ curl -X POST -d 'title=retire&body=I should retire in a nice island' localhost:9292/ideas | |
| # $ curl -X POST -d 'title=ask Satish for a gift&body=Find a way to get Satish to send me a gift' localhost:9292/ideas | |
| # $ curl localhost:9292/ideas |
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 complete_facebook_connect | |
| within_window "Log In | Facebook" do | |
| fill_in 'Email:', with: fb_user.email | |
| fill_in 'Password:', with: fb_user.password | |
| click_button "Log In" | |
| # syncronization makes this never return, maybe because | |
| # it's running in a different window? | |
| without_resyncronize { click_button "Allow" } | |
| end | |
| 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
| vows = require 'vows' | |
| assert = require 'assert' | |
| cb = (callback) -> | |
| setTimeout -> | |
| callback(null, 'callback') | |
| , 2000 | |
| andWaitForCallback = undefined |
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 revoke(user) | |
| proxy_association.owner.tap do |project| | |
| # You can't remove the last user with access (someone has to have access to the project!) | |
| if project.users.many? | |
| if user.pending? && user.projects.one? | |
| user.destroy | |
| else | |
| project.users.delete(user) | |
| user.touch | |
| 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
| alias brake="bundle exec rake $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
| var pitBoss = require('pit_boss'); | |
| // How about... | |
| pitBoss.listen(29999); | |
| // Or... | |
| pitBoss.set(port: 29999).start(); | |
| // Getting worse... | |
| pitBoss.set(port: 29999, tables: 4).onDone(function() { alert('oh noes'); }).start(); |
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 Player() { | |
| this.totalChips = 0.0; | |
| } | |
| Player.prototype.chipCount = function() { | |
| return this.totalChips; | |
| }; | |
| module.exports = Player; |
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 Player() { | |
| this.totalChips = 0.0; | |
| } | |
| Player.prototype.chipCount = function() { |
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
| http://en.wikipedia.org/wiki/File:Casino_Atari_cover.jpg |