Skip to content

Instantly share code, notes, and snippets.

/* 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
We couldn’t find that file to show.
# 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
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);
def hello
"world"
end
@chrisjfunk
chrisjfunk / gist:2486
Created July 25, 2008 18:05
my first java snippet
public void hello() {
return "world!";
};
@tamalw
tamalw / gist:2490
Created July 25, 2008 18:36
Messing around at ShoesFest!
# 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.
require 'openssl'
class String
def to_bin
[self].pack('H*')
end
def to_hex
unpack('H*').first
end
end
vectors = [
<style>
div.row {
clear: both;
padding-top: 10px;
}
div.row span.label {
float: left;
width: 100px;
text-align: right;