Skip to content

Instantly share code, notes, and snippets.

@netguy204
netguy204 / eth address
Created September 21, 2017 13:48
Test account 2
0xf4CFf15F91F30068275CE104817a4b9851A116E1
@netguy204
netguy204 / my testnet address
Last active September 20, 2017 20:41
Ether Request
0x689Ee1a2748a48999eBBe82B3d04669bAd21cFFC
@netguy204
netguy204 / BetaBoard
Created June 25, 2014 01:19
Fun with the Digispark Pro "Beta Supporters" Shield. Uses everything on the board!
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
#include <LedControl.h>
#define JOYX A5
#define JOYY A8
#define BUTTON 1
#define LIGHT A9
LedControl lc = LedControl(10,11,12,1);
#!/usr/bin/env python
import json
import os
import sys
import urllib
import pickle
import re
import csv
from bs4 import BeautifulSoup
@netguy204
netguy204 / Example Output
Created July 28, 2013 02:57
An API for doing prototypical inheritance (with monkey patching) in C++.
I'm an A
I'm an imposter!
I'm super imposing!
I'm also an A
@netguy204
netguy204 / vtable.cpp
Created July 28, 2013 02:11
Monkey patching a C++ class by modifying its VTABLE.
#include <stdio.h>
#include <stdint.h>
class A {
public:
virtual void doThing() {
printf("I'm an A\n");
}
};
@netguy204
netguy204 / call.psl
Created September 16, 2012 12:41
Vectors
deffun vector(x, y, z) { x: x, y: y, z: z } in
deffun sub(v1, v2)
vector( -(v1.x, v2.x), -(v1.y, v2.y), -(v1.z, v2.z))
in
deffun abs(x)
if <(x, 0) then -(0, x) else x
in
@netguy204
netguy204 / obj6.psl
Created September 16, 2012 12:40
Compiler Fail?
deffun counter_inc(self)
self.x = +(self.x, 1)
in
deffun counter_dec(self)
self.x = -(self.x, 1)
in
deffun make_counter(start)
{ inc: counter_inc, dec: counter_dec, x: start }
;; borrowed from ibdknox/jayq
(defn map->js [m]
(let [out (js-obj)]
(doseq [[k v] m]
(aset out (name k) v))
out))
(defn clj->js
"Recursively transforms ClojureScript maps into Javascript objects,
other ClojureScript colls into JavaScript arrays, and ClojureScript
;; borrowed from ibdknox/jayq
(defn map->js [m]
(let [out (js-obj)]
(doseq [[k v] m]
(aset out (name k) v))
out))
(defn clj->js
"Recursively transforms ClojureScript maps into Javascript objects,
other ClojureScript colls into JavaScript arrays, and ClojureScript