I hereby claim:
- I am andrelaszlo on github.
- I am sibilant (https://keybase.io/sibilant) on keybase.
- I have a public key ASAKC1ZDD5z85BC8yXhLazRLqad48O593CtMoupET-WBiAo
To claim this, I am signing this object:
/* | |
* Function that checks if a swedish personnummer is valid. | |
* Author: André Laszlo <andre@laszlo.nu> | |
*/ | |
function check_personnummer(pnr) { | |
// Do formatting and sanity control | |
pnr = pnr.replace(/[^0-9]/g, ''); // only keep digits | |
if (12 == pnr.length) // year format 1985 → 85 | |
pnr = pnr.substr(2); |
#!/usr/bin/python | |
############################################################################### | |
# | |
# Script for generating a truly random password, using atmospheric noise. The | |
# generator uses the web service at random.org | |
# | |
# Usage: | |
# password.py [password length] [alphabet] | |
# For example: password.py 5 abcdefgh |
#!/usr/bin/env bash | |
source token.sh # should export the ACCESS_TOKEN and USER variables | |
PAGE=1 # Run once per page (manually for now) | |
PER_PAGE=100 # Max 100 | |
function list_repos { | |
echo "Listing repos" > /dev/stderr | |
curl -s -H "Authorization: token $ACCESS_TOKEN" "https://api.github.com/search/code?page=$PAGE&per_page=$PER_PAGE&q=http://www.eecs.harvard.edu/~kirsch/pubs/bbbf/esa06.pdf" | \ |
I hereby claim:
To claim this, I am signing this object:
# This file must be used with "source bin/activate" *from bash* | |
# you cannot run it directly | |
# This script was modified to introduce the following features: | |
# * Save and restore PYTHONPATH on activate/deactivate | |
# * Source .virtualenvrc if it exists | |
deactivate () { | |
unset pydoc |
// ==UserScript== | |
// @match http://duego.com/preregister* | |
// @require http://code.jquery.com/jquery-1.4.2.min.js | |
// ==/UserScript== | |
var load,execute,loadAndExecute;load=function(a,b,c){var d;d=document.createElement("script"),d.setAttribute("src",a),b!=null&&d.addEventListener("load",b),c!=null&&d.addEventListener("error",c),document.body.appendChild(d);return d},execute=function(a){var b,c;typeof a=="function"?b="("+a+")();":b=a,c=document.createElement("script"),c.textContent=b,document.body.appendChild(c);return c},loadAndExecute=function(a,b){return load(a,function(){return execute(b)})}; | |
loadAndExecute("//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js", function() { | |
function Notifier() {}; |
<html> | |
<head><title>Kombinationer</title></head> | |
<body> | |
<script> | |
// shorthand function | |
function $(id) { | |
return document.getElementById(id); | |
} |
; haskell mode | |
(load "~/elisp/haskell-mode-2.8.0/haskell-site-file") | |
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode) | |
;These tree indentation modes are mutually exclusive | |
(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation) | |
;;(add-hook 'haskell-mode-hook 'turn-on-haskell-indent) | |
;;(add-hook 'haskell-mode-hook 'turn-on-haskell-simple-indent) |
class PitTree[T](val children : Map[String, PitTree[T]], val value : Option[T]) extends Map[String, T] { | |
def this() = this(Map(), None) | |
def this(value : T) = this(Map(), Some(value)) | |
def update(path : String, upVal : T) : PitTree[T] = update(splitPath(path), upVal) | |
def update(path : List[String], upVal : T) : PitTree[T] = path match { | |
case Nil => | |
new PitTree[T](upVal) | |
case h :: t => | |
val child = children.getOrElse(h, new PitTree[T]()).update(t, upVal) | |
new PitTree[T](children + (h -> child), value) |