This file contains 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
# Sets up expectation so that times aren't off by moments | |
Time.should_receive(:now).and_return(@current_time) | |
@current_time.should_receive(:to_i).and_return(1214619134) |
This file contains 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
class Me | |
def who | |
self | |
end | |
def holdit | |
self.method(:who) | |
end | |
end | |
This file contains 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 Foo = function Request(options) { this.initialize.apply(this, arguments) }; | |
OPTIONS = new Hash({'format': false, 'async': true}) |
This file contains 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
@xhr[:onreadystatechange] = self.on_state_change |
This file contains 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
this.$xhr.$onreadystatechange = this.onStateChange(); |
This file contains 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
return $nil |
This file contains 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
if ($T(type.match((/DOMMouseScroll|mousewheel/)))) { var wheel = ($T(nativeEvent.wheelDelta) ? (nativeEvent.wheelDelta / (120)) : ($T(_a=nativeEvent.detail)?_a:(0).-() / (3))); }; | |
// a = nativeEvent.detail.-() |
This file contains 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
class BalanceError(Exception): | |
value = "Sorry you only have $%6.2f in your account" | |
class BankAccount: | |
def __init__(self, initialAmount): | |
self.balance = initialAmount | |
print "Account created with balance %5.2f" % self.balance | |
def deposit(self, amount): | |
self.balance = self.balance + amount |
This file contains 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
from routes import * | |
from routes.util import url_for | |
m = Mapper() | |
m.resource('blog', 'blogs') | |
m.create_regs(['blogs']) | |
url_for('blog', id=2) # outputs '/blogs/2' | |
m.match('/blogs/2') # no match |
This file contains 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
if foreigner = terrorist | |
imprison(foreigner) | |
else | |
release(foreigner) | |
end |
OlderNewer