Skip to content

Instantly share code, notes, and snippets.

@leroux
leroux / keybase.md
Created June 7, 2015 04:23
Keybase.io Github Verification

Keybase proof

I hereby claim:

  • I am leroux on github.
  • I am muhaiminahsan (https://keybase.io/muhaiminahsan) on keybase.
  • I have a public key whose fingerprint is E173 DF83 C878 C15B C600 48B8 E22F 2701 DEE0 CF5D

To claim this, I am signing this object:

# Heavily depends on:
# libqrencode (fukuchi.org/works/qrencode/)
# paperkey (jabberwocky.com/software/paperkey/)
# zbar (zbar.sourceforge.net)
# Producing the QR codes:
# Split over 4 codes to ensure the data per image is not too large.
gpg --export-secret-key KEYIDGOESHERE | paperkey --output-type raw | base64 > temp
split temp -n 4 IMG
for f in IMG*; do cat $f | qrencode -o $f.png; done
@leroux
leroux / dabears_mixes.txt
Last active April 12, 2019 19:49
Scrape mix links from dabears posts. (You can `parallel` or `wget -i` all of them afterwards.)
http://mixes.dabears.ca/dabears_shimmers.mp3
http://mixes.dabears.ca/dabears_wonderland.mp3
http://mixes.dabears.ca/dabears_paralyzer.mp3
http://mixes.dabears.ca/dabears_ilhm2012.mp3
http://mixes.dabears.ca/dabears_eloquence.mp3
http://www.dabears.ca/dabears_elixir.mp3
http://mixes.dabears.ca/dabears_turbulence.mp3
http://mixes.dabears.ca/dabears_serene.mp3
http://mixes.dabears.ca/dabears_ether.mp3
http://mixes.dabears.ca/dabears_embers.mp3
@leroux
leroux / scrape-worm-separate.py
Last active January 1, 2016 02:29
Hacky Worm Scraper
# Worm Scraper by Arc
# Use pandoc to convert into something nicer.
import re
from bs4 import BeautifulSoup
from urllib2 import urlopen
url = "http://parahumans.wordpress.com/category/stories-arcs-1-10/arc-1-gestation/1-01/"
{
"add_to_PATH":
[
"/usr/local/bin/",
"~/.cabal/bin"
],
"auto_build_mode": "normal",
"enable_auto_build": false,
"enable_auto_lint": true,
"enable_ghc_mod": true,
#!/bin/bash -xe
SYSTEM=$(uname)
case $SYSTEM in
Darwin)
export PUBLIC=/data/Home/Dropbox/ghc
;;
Linux)
export PUBLIC=/srv/dropbox/ghc
;;
@leroux
leroux / ADTAlgebra.hs
Last active December 28, 2015 09:29
ADT Algebra
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE TypeOperators #-}
module ADTAlgebra where
type Algebra f a = f a -> a
type Coalgebra f a = a -> f a
type Bialgebra f a = (Algebra f a, Coalgebra f a)

Mailman Chaos

Injection Fix

./inject-newer-mail.sh <bin/inject> <old-mbox> <new-mbox> <listname> # (new-mbox) // (old-mbox) is injected into archive queue.
bin/qrunner -v -r ARch # start Archive queue runner (Processes the archive queue).
  • Logs: error, smtp, fail, and vette.
module Queue where
data Queue a = Queue [a] [a]
deriving (Show, Eq)
emptyQueue :: Queue a
emptyQueue = Queue [] []
push :: a -> Queue a -> Queue a
push x (Queue d e) = Queue d (x:e)