Skip to content

Instantly share code, notes, and snippets.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}[scale=2.3]
\node (1) at (-0.77,0.5) {$1$};
\node (NL) at (0,1) {$N$};
use Modern::Perl;
while (<>) {
# Kill
s{<abr>\w+</abr> \s+ <rref>.*wav</rref>}{}xg;
s{<rref>.*\.(wav|jpg)</rref>}{}g;
# Head
s{<k>.*</k>}{};
@llelf
llelf / vec.hs
Created November 30, 2013 16:37
{-# LANGUAGE ForeignFunctionInterface #-}
import System.Environment
import qualified Data.Vector as V
import Control.Monad (join)
import Data.Word
import Criterion.Main
import Foreign.C
import Foreign.Marshal
import Foreign.Ptr
@llelf
llelf / clib.c
Created November 30, 2013 18:01
#include <stdio.h>
int result_c (int max_a0, int *max_len_r, int *longest_r) {
int longest = 0, max_len = 0;
int a0, len;
unsigned long a;
for (a0 = 1; a0 <= max_a0; a0++) {
a = a0;
len = 0;
@llelf
llelf / hammer
Last active December 30, 2015 17:39
[lelf@dragon ~]$ echo 11111111 > myfile
[lelf@dragon ~]$ sync
[lelf@dragon ~]$ echo 22222222 >> myfile
[lelf@dragon ~]$ sync
[lelf@dragon ~]$ hammer history myfile
myfile 00000001073a3ee6 clean {
00000001073abc60 08-Dec-2013 23:05:34
00000001073abd20 08-Dec-2013 23:05:47
}
@llelf
llelf / -
Created January 14, 2016 08:40
$ riak-admin bucket-type create --help
--help created

Keybase proof

I hereby claim:

  • I am llelf on github.
  • I am lelf (https://keybase.io/lelf) on keybase.
  • I have a public key ASCut-M2ylTC8ta3u74-HP2XbSgF7j7D3u4TTPIObH4YOwo

To claim this, I am signing this object:

@llelf
llelf / liftedMonoid.hs
Created May 3, 2018 04:51 — forked from sjoerdvisscher/liftedMonoid.hs
If you have a Functor f with an instance Monoid a => Monoid (f a), f is Applicative!
{-# LANGUAGE TypeOperators, ScopedTypeVariables, TupleSections #-}
import Data.Constraint
import Data.Monoid
import Control.Applicative
pureDefault :: forall f a. Functor f
=> (Monoid () :- Monoid (f ()))
-> a -> f a
@llelf
llelf / alacarte.hs
Last active September 5, 2019 08:51 — forked from dredozubov/alacarte.hs
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeApplications #-}
module ALaCarte where
@llelf
llelf / ip1.hs
Last active March 14, 2020 18:30
{-# LANGUAGE GADTs, ConstraintKinds, Rank2Types, ImplicitParams #-}
data Rec fields where
Rec :: fields => Rec fields
infixr 1 ?
(?) :: Rec fields -> (fields => r) -> r
Rec ? e = e
record :: Rec (?a :: Int, ?b :: String)