Discover gists
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
/* Ruby Thread support: | |
Ruby implements threads by using setjmp/longjmp to switch between separate | |
C stacks within one native thread. | |
This confuses Objective C because NSThread stores a per-native-thread stack | |
of autorelease pools and exception handlers. When the C stack changes, an | |
error message like this is likely to appear: | |
Exception handlers were not properly removed. Some code has jumped or |
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
# aldershot.rb | |
=begin | |
main file for aldershot mountain. | |
aldershot mountain is/will be a (currently) | |
simple chutes and ladders/snakes and | |
ladder/adders and ladders/moksha patamu/ | |
gyanbazi/leela ripoff. | |
=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
Date.prototype.atSomePoint = function(hours) { | |
var startHour = new Date(this.valueOf()); | |
var endHour = new Date(this.valueOf()); | |
startHour.setSeconds(0); | |
startHour.setMinutes(0); | |
endHour.setSeconds(0); | |
endHour.setMinutes(0); | |
if (hours) { | |
startHour.setHours(hours.between); | |
endHour.setHours(hours.and); |
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 hello | |
"world" | |
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
public void hello() { | |
return "world!"; | |
}; |
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
# The goal is to have all the words on one line, with "shoes" bold, larger, and a different color | |
Shoes.app do | |
background black | |
# Looks okay | |
flow do | |
subtitle "I want new ", | |
strong("shoes", :stroke => chocolate), |
This file has been truncated, but you can view the full file.
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 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
require 'openssl' | |
class String | |
def to_bin | |
[self].pack('H*') | |
end | |
def to_hex | |
unpack('H*').first | |
end | |
end | |
vectors = [ |
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
<style> | |
div.row { | |
clear: both; | |
padding-top: 10px; | |
} | |
div.row span.label { | |
float: left; | |
width: 100px; | |
text-align: right; |