Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am bavardage on github.
* I am bavardage (https://keybase.io/bavardage) on keybase.
* I have a public key whose fingerprint is CF6B 3BE9 DB74 3401 6770 8576 D215 3D62 90DA 3472
To claim this, I am signing this object:
import logging
import pickle
import os
import shutil
import sys
import time
PROTOCOL = 0 #keep as ascii for now for debug funsies
//tabs
require("new-tabs.js");
//webjumps
define_webjump("youtube", "http://www.youtube.com/results?search_query=%s&search=Search");
define_webjump("l", "http://dict.leo.org/ende?search=%s");
define_webjump("hoogle", "http://www.haskell.org/hoogle/?hoogle=%s");
define_webjump("hg", "http://www.google.com/codesearch?hl=en&q=lang%3Ahaskell+%s");
##
## Put me in ~/.irssi/scripts, and then execute the following in irssi:
##
## /load perl
## /script load notify
##
use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
let list = (cons 1n (cons 1n nil)),
nextfib = λ l. (cons (putNat (addN (head l) (head (tail l)))) l)
in
(putNat (head (iterate 25n nextfib list)))
let zero = λ f x. x,
succ = λ n f x. (f (n f x)),
pred = λ n f x. (n (λ g h. (h (g f))) (λ u. x) (λ u. u))
in
let one = (succ zero) in
let two = (succ one) in
let three = (succ two) in
let four = (succ three) in
let five = (succ four)
sumseries f a b = sum[f n|n<-[a..b]]
data Σ a = Σ (a -> a) a a
instance (Show a, Num a, Enum a) => Show (Σ a) where
show (Σ f a b) = show $ sumseries f a b
type Zipper a = ([a], a, [a])
fibs = ([1,1,2,3,5], 8, [13,21]) :: Zipper Int
left (xs, y, (z:zs)) = (y:xs, z, zs)
divides k n = rem n k == 0
sieve :: [Integer] -> [Integer]
sieve [] = []
sieve (0:xs) = sieve xs
sieve (1:xs) = sieve xs
sieve (x:xs) = x : sieve (removeMultiplesOf x xs)
#!/usr/bin/env python
import curses
import signal
import traceback
import time
DIGIT_WIDTH = 5
DIGIT_HEIGHT = 5
DIGIT_SPACING = 2