Skip to content

Instantly share code, notes, and snippets.

View fwg's full-sized avatar
🐒
I'm a potato.

Friedemann Altrock fwg

🐒
I'm a potato.
View GitHub Profile
@fwg
fwg / winwhich.bat
Created June 14, 2021 10:26
Windows which
@echo off
php %USERPROFILE%\bin\winwhich.php %*

Keybase proof

I hereby claim:

  • I am fwg on github.
  • I am fwg (https://keybase.io/fwg) on keybase.
  • I have a public key ASCWWOeJko39dNOYrRQKgWwq95OlzNy3R7XyKTjLQLbBYAo

To claim this, I am signing this object:

@fwg
fwg / index-peg.js
Created May 7, 2015 00:22
s-expression PEG.js grammar
var S = require('./peg-gen8');
function P(stream) {
try {
return S.parse(stream);
} catch (e) {
if (!(e instanceof S.SyntaxError)) throw e;
if (e.message == 'Expected "\\"", "\\\\", "\\\\\\"" or any character but end of input found.') {
e.message = 'Syntax error: Unterminated string literal';
}
@fwg
fwg / index.js
Created September 8, 2014 19:29
requirebin sketch
var S = require('s-expression');
var e = S("(\"a a\")");
document.write(JSON.stringify(e));
@fwg
fwg / index.js
Last active August 29, 2015 14:06
requirebin sketch
var S = require('s-expression');
var e = S("(\"a a\")");
document.body.appendChild(document.createTextNode(JSON.stringify(e)));
let f(h as (Number) -> Number, x as Number)
// h should take a parameter. it does not, but who cares.
let v = h(x)
// now v should be a Number, right?
// because we told GorillaScript up there, of course it can optimize this condition away
if (typeof v == "number" or v instanceof Number)
v / 1.23
let g()
@fwg
fwg / Index.md
Last active December 15, 2015 19:19
OpenHack Berlin first meetup on the 4th of April

OpenHack Berlin, First Edition

  • 19:30 – Official start, real beginning is cum tempora ;)
  • 19:45 – Introductions: say who you are and what you want to do
  • 20:00 – Hack on anything
  • 23:00 – Bring it to the tribe. The chance to ask for guidance/advice on your current challenges.

@fwg
fwg / currying.js
Last active December 15, 2015 04:50 — forked from puffnfresh/currying.js
function curry(f) {
return function() {
if(arguments.length < f.length)
return curry(f.bind.apply(f, [this].concat([].slice.call(arguments))));
return f.apply(this, arguments);
};
}
var sum = curry(function(x, y) {
return x + y;
@fwg
fwg / survivor.js
Last active December 15, 2015 00:49
melanie349's survivor class
// Survivor Class
function Survivor() {
this.markers = [];
this.path = [];
this.labels = [];
this.polyline = null;
this.auditPoints = [];
// array to keep the functions that will be called when the data is loaded
this.callbacks = [];