View blink.js
View apollo.js
// 0. open url: http://www.apolloarchive.com/apollo_gallery.html
// (n.b. all images to be downloaded are in the public domain)
// 1. install jquery by running this snippet in the console:
var s = document.createElement('script');
s.src = 'https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js';
(document.getElementsByTagName('head')[0] ||
document.getElementsByTagName('body')[0]).appendChild(s);
View object-literal.js
;(function(window, undefined) {
'use strict';
var SomeObj = function(opts) {
if (opts.whatever) this.isWhatever = true;
// do some constructor stuff
this.init(opts.thing);
};
View fun.js
> var foo = function() { return foo; }
undefined
> foo
function () { return foo; }
> foo()
function () { return foo; }
> foo()() === foo()()()()()()()()
View scroll-to-top.js
// full-source version:
javascript:(function(win) {
var STEP_SIZE = 200; // px
var DELAY = 20; // ms
var ease = function(scrollTop) {
if (scrollTop <= STEP_SIZE) {
win.scroll(0, 0);
View google-results.sh
#!/usr/bin/env sh
# $ ./google-results.sh
# Fri Sep 30 15:43:01 EDT 2011|http://www.google.com/search?q=site:amazon.com|360,000,000
# Fri Sep 30 15:43:06 EDT 2011|http://www.google.com/search?q=site:apple.com|46,500,000
# Fri Sep 30 15:43:11 EDT 2011|http://www.google.com/search?q=site:facebook.com|2,600,000,000
# Fri Sep 30 15:43:16 EDT 2011|http://www.google.com/search?q=site:google.com|281,000,000
URLS=(
"http://www.google.com/search?q=site:amazon.com"
View brubeck-install.sh
#!/usr/bin/env sh
# Brubeck install script cribbed from: http://brubeck.io/installing.html
# Version numbers and directories.
ZMQ_VERSION="2.1.9"
VIRTUALENVWRAPPER_SH="/usr/local/bin/virtualenvwrapper.sh"
VIRTUALENV_NAME="brubeck"
View smiley.c
#include <assert.h>
#include <stdio.h>
#include <cairo.h>
#define PIXEL_SIZE 50
void draw_to_file(const char *filename)
{
assert(filename != NULL);
View ll.c
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct node {
char *str;
struct node *next;
} Node;
/* list */