Skip to content

Instantly share code, notes, and snippets.

@robyoung
robyoung / gist:2580217
Created May 2, 2012 20:33
Bit set encoding for number of options in a url
import unittest
import math
import base64
import bz2
import gzip
import StringIO
import struct
class BitSetEncoder(object):
def encode(self, integers):
@robyoung
robyoung / gist:2204735
Created March 26, 2012 12:20
Slice of strings
// I would like to be able to write this
var labels = []string{"one", "two", "three"}
// ...something like this
var labels = []string{
"one",
"two",
"three"
}
@robyoung
robyoung / link.html
Created January 9, 2012 07:59
An example link
confirm("Write me to a confirm");
// alert("A commented out alert");
// this is a commend
@robyoung
robyoung / gist:1493501
Created December 18, 2011 14:02
An alert
alert("Write me to an alert");
@robyoung
robyoung / gist:1493489
Created December 18, 2011 13:57
Write to the document
document.write("Write me to the page");
@robyoung
robyoung / gist:1428499
Created December 3, 2011 23:33
number-guessing-game-template
<!DOCTYPE html>
<html>
<body>
<h1>Amazing Number Guessing Game</h1>
<div id="result"></div>
<button id="reset">reset</button>
<input type="text" name="value" id="value">
<button id="ask">ask</button>
@robyoung
robyoung / gist:1428445
Created December 3, 2011 23:09
css-rule-5
#foo {
background-color: #f99;
}
@robyoung
robyoung / gist:1428419
Created December 3, 2011 22:56
Web Page Week Two
<html>
<head>
<style>
body {
background-color: #ada;
font-family: Helvetica, sans-serif;
}
#content {
width: 800px;