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.
<?xml version="1.0" encoding="UTF-8"?><moo xsi:noNamespaceSchemaLocation="http://www.moo.com/xsd/api_0.7.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><request><version>0.7</version><api_key>056014df-68e5-c0a802d2-47f0a98d-3045</api_key><call>build</call></request><payload><products><product><product_type>minicard</product_type><designs><design><image><url>http://peoplesmusicstore.com/images/uploaded/0000/0578/100_0098.JPG</url><type>variable</type><crop><auto>true</auto></crop></image><text_collection><minicard><text_line><id>1</id><string>The Sound Advise</string><bold>false</bold><align>left</align><font>modern</font><colour>#000000</colour></text_line><text_line><id>2</id><string></string><bold>false</bold><align>left</align><font>modern</font><colour>#000000</colour></text_line><text_line><id>3</id><string></string><bold>false</bold><align>left</align><font>modern</font><colour>#000000</colour></text_line><text_line><id>4</id><string>peoplesmusicstore.com/thesoundadvise</string><bold>false</
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;