Skip to content

Instantly share code, notes, and snippets.

View serapath's full-sized avatar
💔
Github was acquired

Alexander Praetorius serapath

💔
Github was acquired
View GitHub Profile
@serapath
serapath / gist:d578601bd31b76f31b8a
Last active August 29, 2015 14:07
Verifying that +serapath is my openname (Bitcoin username): https://onename.io/serapath
Verifying that +serapath is my openname (Bitcoin username): https://onename.io/serapath
@serapath
serapath / gist:a506065c9f25b20595dd
Last active September 23, 2015 03:02
Keybase proof
### Keybase proof
I hereby claim:
* I am serapath on github.
* I am serapath (https://keybase.io/serapath) on keybase.
* I have a public key whose fingerprint is B6E8 4291 380F C7CA 13BD 4AAC CC1E CE17 E471 F574
To claim this, I am signing this object:
@serapath
serapath / index.html
Last active September 23, 2015 16:16
App Loader with Update Manager
<body><script>
/* SET `$appurl` as argument to the IIFE
to load any javascript (localstorage size limit 5mb)
The first page visit will load the whole script, follow-up visits
load the cached script right away and if a new version is available,
offer to update the app now or later.
(The caching only works if the server sends `header.etag`)
I welcome suggestions/questions/discussions - just drop me a message :-)
http://twitter.com/serapath
@serapath
serapath / index.js
Last active December 20, 2015 07:52
Virtual Level Tracker
/********************************************************************
COMPONENT - ./MyThunk.js
********************************************************************/
// module.exports = MyThunk
function Hook (db, component, tracks, TEMP) {
this.db = db
this.component = component
this.tracks = tracks
this.TEMP = TEMP
this.untrack = []
@serapath
serapath / Comments in Source Files
Last active February 1, 2016 00:16
Comments in Source Files
/*
Make use of:
@NOTE
@REVIEW
@HACK
@IDEA
@XXX
@FIXME
@TODO
@serapath
serapath / keyboardlayout.js
Created February 5, 2016 20:32
User needs to type a unique pattern of keys
// <html>
// <head>
// <meta charset="UTF-8">
// </head>
// <body>
// <script src="asdf.js"></script>
// </body>
// </html>
var charOE = 'ö'.charCodeAt(0)
var charSEMICOLON = ';'.charCodeAt(0)
@serapath
serapath / ycomb.js
Created May 21, 2016 16:55
y combinator
function Y (F) {
function fn (x) {
return F(function (y) { return x(x)(y) })
}
return F(function (y) { return fn(fn)(y) })
}
function FactGen (fact) {
return function (n) {
return (n == 0) ? 1 : (n*fact(n-1))
@serapath
serapath / index.js
Last active July 3, 2016 18:39
requirebin sketch
require('dom-console')({console:true,initAction:'minimize'})
/******************************************************************************
HELPER
******************************************************************************/
var apply=J=>J.forEach(b=>b.forEach(e=>e[0][e[1]]?e[0][e[1]]+=e[2]:e[0][e[1]]=e[2]))
var log=E=>console.log(E)
/******************************************************************************
"VALUE EQUATIONS"
******************************************************************************/
CONTRACT = {
@serapath
serapath / index.js
Created August 16, 2016 17:51
requirebin sketch
setInterval(function(xhr, randCol) {
var color=(color=randCol().hexString()).slice(1,color.length)
xhr({url:'http://192.168.2.4/change_color',method:'POST',data:'color='+color})
},3000, require('minixhr'), require('random-color'))
@serapath
serapath / args.js
Created September 14, 2016 23:36
cli args
var r={};'hello x=5 hey="cool"'.replace(/([^=\s]+)(?:\s*=\s*(?:"([^"]*?)"|\'([^']*?)\'|(\S*)))?/g,function(_,k,d,s,b){r[k]=d||s||b||true});r