Skip to content

Instantly share code, notes, and snippets.

@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);
; batch watermarking tool written in script-fu for the gimp
; Copyright 2010 Brian Taylor
; el.wubo@gmail.com
;
; Redistribute under the terms of the GNU General Public License version 2 or better
(define (add-text org-img new-layer msg-x msg-y the-text the-size the-font)
(let* ((floating-layer (car (gimp-text-fontname org-img new-layer msg-x msg-y the-text 1 TRUE the-size 0 the-font))))
(gimp-floating-sel-anchor floating-layer)))
Atom* lithp2_apply(Cons* env, Atom* list)
{
DEBUG1("lithp2_apply: %s", list);
// sanity check
if(!list || !ISCONS(list)) {
ERROR1("cannot apply a non cons: %s", list);
return NIL;
}
;; 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
@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 }
@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
#!/usr/bin/env python
import json
import os
import sys
import urllib
import pickle
import re
import csv
from bs4 import BeautifulSoup
@netguy204
netguy204 / my testnet address
Last active September 20, 2017 20:41
Ether Request
0x689Ee1a2748a48999eBBe82B3d04669bAd21cFFC