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
%w(rubygems json rest-client).map{|a|require a};puts"Amount betted:";a = gets;JSON.parse(RestClient.get("http://roulette.engineyard.com/")).each_pair{|k,v|v.eql?("13") ? (puts"You've won #{a.to_i*35}"):(puts "No winnings!")} |
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
def ninja(&block) | |
if block_given? | |
block.call("ninja") | |
else | |
puts "laser" | |
end | |
end | |
ninja do |hugo| | |
puts "Block:"+hugo |
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
/* | |
* A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined | |
* in FIPS 180-1 | |
* Version 2.2 Copyright Paul Johnston 2000 - 2009. | |
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet | |
* Distributed under the BSD License | |
* See http://pajhome.org.uk/crypt/md5 for details. | |
*/ | |
/* |
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
nightgaunt:VideoTestVLC buffpojken$ rake | |
Build ./build/MacOSX-10.9-Development | |
Compile ./app/menu.rb | |
Compile ./app/app_delegate.rb | |
Compile ./app/Controllers/video_controller.rb | |
Create ./build/MacOSX-10.9-Development/VideoTestVLC.app/Contents | |
Create ./build/MacOSX-10.9-Development/VideoTestVLC.app/Contents/MacOS | |
Link ./build/MacOSX-10.9-Development/VideoTestVLC.app/Contents/MacOS/VideoTestVLC | |
Create ./build/MacOSX-10.9-Development/VideoTestVLC.app/Contents/PkgInfo | |
Copy /Users/buffpojken/Projects/Motion/VideoTestVLC/VLCKit.framework |
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 ChannelListHeaderLayout < MotionKit::Layout | |
def layout | |
root :cell do | |
add UIImageView, :logo | |
end | |
end | |
def cell_style | |
background_color UIColor.whiteColor |
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 ChannelListHeaderLayout < MotionKit::Layout | |
def layout | |
root :cell do | |
context target.contentView do | |
add UIImageView, :logo | |
end | |
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
class TrueClass | |
def ! | |
return !super | |
end | |
end | |
should_be_true = (1 == 1) | |
if !should_be_true | |
puts "I'm so not true..." # => I'm so not 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
class Array | |
alias_method :_each, :each | |
def each(&block) | |
cpy = Array.new(self) | |
cpy.pop | |
cpy._each{|n| block.call(n) } | |
end | |
end | |
a = [1,2,3] |
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 Array | |
alias_method :_each, :each | |
def each(&block) | |
cpy = Array.new(self) | |
cpy.pop | |
cpy._each{|n| block.call(n) } | |
end | |
end | |
a = [1,2,3] |
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 TrueClass | |
def ! | |
return ((rand > 0.1) && Time.new.wday.eql?(1) ? super : !super) | |
end | |
end | |
should_be_true = (1 == 1) | |
# This will be correct ~ 10% of the cases if it's monday. | |
if !should_be_true |
OlderNewer