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 GADTs #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
data Z | |
data S n | |
data Natural :: * -> * where | |
NumZ :: Natural Z | |
NumS :: Natural n -> Natural (S n) |
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 | |
import System.Environment | |
import qualified Data.ByteString.Char8 as C | |
import qualified Data.Text as T | |
import qualified Data.Text.IO as T | |
import qualified Data.Text.Read as T | |
readBaseline :: FilePath -> IO [Int] | |
readBaseline filename = map parse . words <$> readFile filename | |
where parse :: String -> Int |
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 python | |
# -*- coding: utf-8 -*- | |
import collections | |
def flatten(lst): | |
"""Flatten a iterable. | |
>>> from __future__ import print_function | |
>>> lst = [[1, 2], [], [1, [[2, 3], 3]], 4, 5] | |
>>> print(flatten(lst)) | |
[1, 2, 1, 2, 3, 3, 4, 5] |
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
from pipeline import pipeline | |
class Cleaner(object): | |
def __init__(self): | |
self.pipeline = pipeline | |
def add_pipeline(self, p): | |
self.pipeline.append(p) | |
def __call__(self, s): |
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
" URL: http://vim.wikia.com/wiki/Example_vimrc | |
" Authors: http://vim.wikia.com/wiki/Vim_on_Freenode | |
" Description: A minimal, but feature rich, example .vimrc. If you are a | |
" newbie, basing your first .vimrc on this file is a good choice. | |
" If you're a more advanced user, building your own .vimrc based | |
" on this file is still a good idea. | |
"------------------------------------------------------------ | |
" Features {{{1 | |
" |
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
#!/bin/bash | |
# Script for installing tmux on systems where you don't have root access. | |
# tmux will be installed in $HOME/local/bin. | |
# It's assumed that wget and a C/C++ compiler are installed. | |
# exit on error | |
set -e | |
TMUX_VERSION=2.2 |
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
#!/bin/bash | |
# | |
if [ "$#" -lt 6 ]; then | |
echo "./ovpn-writer.sh <server address> <protocol> " | |
echo " <port> <ca certificate> " | |
echo " <client certificate> <client key>" | |
echo " [tls key] " | |
exit 1 | |
fi |