Skip to content

Instantly share code, notes, and snippets.

View rwaldron's full-sized avatar

Rick Waldron rwaldron

  • Boston, MA
View GitHub Profile
@rwaldron
rwaldron / node.c
Created July 19, 2013 03:35 — forked from dherman/node.c
#include <stdio.h>
int main() {
int *p = 0;
char line[1024];
printf("> ");
fgets(line, 1024, stdin);
*p = 12;
var five = require('johnny-five');
var board = new five.Board();
board.on("ready", function () {
var leds = new Array(5);
for (var i = 0; i < 5; i++) {
leds[i] = new five.Led({pin: i + 5});
}
;;; Hy tumblr printer.
;;; Copyright (c) Paul R. Tagliamonte, 2013, MIT/Expat license.
(import [urllib2 [urlopen]]
[lxml [etree]]
[sys [argv]])
(defn get-rss-feed-name [tumblr]
@rwaldron
rwaldron / legis.R
Created June 13, 2013 17:49 — forked from Protonk/legis.R
# fast json library for R.
# drop in replacement for rjson (another library)
# use whatever you prefer
library(RJSONIO)
## hardcoded for this test
ny.json <- fromJSON("/Users/protonk/dev/R/nomnom/data.json")
unflatten <- function(json) {
var five = require("./lib/johnny-five.js"),
board, slider;
board = new five.Board();
board.on("ready", function() {
var accel = new five.Accelerometer({
pins: [ "I0", "I1" ],
freq: 100
exampleWithNumber: x
"A method that illustrates every part of Smalltalk method syntax
except primitives. It has unary, binary, and keyword messages,
declares arguments and temporaries, accesses a global variable
(but not and instance variable), uses literals (array, character,
symbol, string, integer, float), uses the pseudo variables
true false, nil, self, and super, and has sequence, assignment,
return and cascade. It has both zero argument and one argument blocks."
class Mapping {
// Subclasses define at least @@iterator().
@@iterator() {
throw TypeError("abstract operation")
}
// Mutable subclasses also define set() and delete().
set(key, value) {
throw TypeError("mapping is not mutable");
}
struct Point {
function void Point(double x, double y) {
this->x = x;
this->y = y;
}
double x, y;
}
function int add1(int x) {
// assumes little endian
// constants taken from http://nikic.github.com/2012/02/02/Pointer-magic-for-efficient-dynamic-value-representations.html
var MAXDOUBLE = 0xfff80000,
INT32TAG = 0xfff90000,
BOOLTAG = 0xfffa0000;
var heap = new ArrayBuffer(24),
f64 = new Float64Array(heap),
ui32 = new Uint32Array(heap),
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE