This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export DOWNLOAD_PATH=$HOME/Desktop | |
gcj () { | |
[ -e $DOWNLOAD_PATH/*.in ] || return | |
file=`ls $DOWNLOAD_PATH/*.in | head -n1` | |
echo "Filename $file" | |
problem=`basename $file | sed 's/^\([A-Z]\)-.*\.in/\1/g'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.IntMap (IntMap) | |
import qualified Data.IntMap as IntMap | |
import Data.List (transpose) | |
import Control.Monad (zipWithM_) | |
newtype Vector a = Vector { unVector :: IntMap a } | |
vector :: Num a => IntMap a -> Vector a | |
vector = Vector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE RankNTypes, MultiParamTypeClasses, FlexibleInstances, FlexibleContexts, ScopedTypeVariables #-} | |
module ModP | |
( modP | |
) where | |
import Data.Ratio | |
newtype Dep a b = Dep { unDep :: b } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@font-face { | |
font-family: 'PT Mono'; | |
font-style: normal; | |
font-weight: normal; | |
src: local("☺"), url('fonts/PT_Mono-Regular.ttf') format('truetype'); | |
} | |
@font-face { | |
font-family: 'PT Sans'; | |
font-style: normal; | |
font-weight: bold; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bdfmerge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
while true; do | |
find "`dirname $0`" -type f \( -name '*.jpg' -o -name '*.png' \) -print0 | shuf -z | shuf -z | shuf -z -n5 | xargs -0 feh --bg-max | |
sleep 1m | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE RankNTypes #-} | |
import Data.Int | |
import Control.Monad.ST | |
import Control.Monad | |
import Data.Function | |
import Data.Hashable | |
import qualified Data.HashTable.ST.Cuckoo as H | |
type Func a b = (a -> b) -> (a -> b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Criterion.Main | |
merge2 :: Ord a => [a] -> [a] -> [a] | |
merge2 (x:xs) (y:ys) = case compare x y of | |
EQ -> x : merge2 xs ys | |
LT -> x : merge2 xs (y:ys) | |
GT -> y : merge2 (x:xs) ys | |
hemming :: [Integer] | |
hemming = 1 : (map (*2) hemming `merge2` map (*3) hemming `merge2` map (*5) hemming) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ipv4_inv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Lookup musicbrainz and freedb by EAC log. | |
Copyright 2010, kolen | |
Released under the MIT License | |
--> | |
<html> | |
<head> | |
<title>Look up musicbrainz disc id and freedb id from EAC/XLD log</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> |
OlderNewer