Skip to content

Instantly share code, notes, and snippets.

View heyLu's full-sized avatar

Luna Stadler heyLu

  • Leipzig
  • 20:48 (UTC +02:00)
View GitHub Profile
@heyLu
heyLu / evalo-session.txt
Last active August 29, 2015 14:14
(evalo q '() '(1 2 3))
A tiny REPL session demonstrating `evalo` (https://github.com/heyLu/lp/blob/master/scm/evalo.scm).
$ petite 2015-02-02 1:14PM
Petite Chez Scheme Version 8.4
Copyright (c) 1985-2011 Cadence Research Systems
> (load "evalo.scm")
> (run 1 (q) (evalo q '() '(1 2 3)))
('(1 2 3))
> (run 4 (q) (evalo q '() '(1 2 3)))
@heyLu
heyLu / default_dict.py
Last active August 29, 2015 14:02
default dict
from collections import defaultdict
d = defaultdict(lambda: 42)
d["hello"] = "world"
d["hello"] # => 'world'
d["answer"] # => 42
@heyLu
heyLu / cookies.txt
Last active January 2, 2016 04:59
cookies
http://www.veganguerilla.de/chocolate-chip-cookies/
http://www.huffingtonpost.de/2013/12/03/vegane-plaetzchen-rezepte_n_4373908.html (zimtsterne)
http://veganania.wordpress.com/2012/12/22/rezept-zimtsterne/
@heyLu
heyLu / util-v0.js
Created July 23, 2013 18:44
util.js
var req=function(params){var xhr=new XMLHttpRequest();xhr.open(params.verb||'GET', params.url);for(name in params.headers||[]){xhr.setRequestHeader(name, (params.headers||[])[name])};cb=console.log.bind(console);xhr.onerror=params.error||cb;xhr.onreadystatechange=params.cb||cb;return xhr};
var mkparams=function(params){var param_str="";for (key in params){var sep=param_str==""?"?":"&";param_str+=sep+key+"="+params[key]};return param_str}
var q=function(sel){return document.querySelector(sel)}
var qa=function(sel){return document.querySelectorAll(sel)}
var range=function(from,to){var ary = [];for(var i=0;i<from+to;i++){ary[from+i]=from+i;};return ary}
var slug=function(str){return str.replace(/[^\w\d\s]/g, "").trim().replace(/\s+/g, "-")}
drop table sounds;
drop table videos;
create table sounds (
id number constraint sounds_pk primary key,
sound ordsys.ORDAudio
);
create or replace directory AUDIODIR as '/home/lstadler/oracle';
@heyLu
heyLu / LICENSE.md
Created January 8, 2013 19:32
The Hopeful License

THE HOPEFUL LICENSE

Dear Future User of this Software,

I hope that you will find this software useful and that it brings joy to your computing life.

But most of all, I hope that you continue using this software in the spirit that it was created: the hope that it may be useful and that it can improve the computing life of many people. Thus, I hope

@heyLu
heyLu / unix-one-liners.md
Created December 8, 2012 13:48
Unix one liners
  • join all lines from a file
    • sed ':a;N;s/\n/ /;ta' $file
    • tr '\n' ' ' < $file
  • paste -s --delimiter=' ' $file
drop table production;
drop table product;
/* 1a
Erzeugnis <1 Fertigung n> Zwischenerzeugnis
*/
/* 1b
@heyLu
heyLu / LICENSE.txt
Created November 27, 2012 14:40 — forked from 140bytes/LICENSE.txt
140byt.es -- Fun with bidirectionality and Unicode (inspired by xkcd #1137)
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Lucas Stadler <http://papill0n.org>
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