This file contains hidden or 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 | |
set -e | |
# source $HOME/.google/api_keys | |
USER="$1" | |
if [ ! "$USER" ] | |
then |
This file contains hidden or 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 MultiParamTypeClasses, FunctionalDependencies #-} | |
module Sort | |
( windowSort | |
, Windowed(..) | |
) | |
where |
This file contains hidden or 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 DeriveFunctor #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE TypeOperators #-} | |
import Control.Monad | |
{- |
This file contains hidden or 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
-- Sampler V2 | |
import Data.Time.Clock.POSIX | |
import Control.Monad | |
import System.Environment | |
import System.IO | |
import System.Exit | |
import Text.Read |
This file contains hidden or 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 [ -f .dockername ] | |
then | |
N=$(cat .dockername) | |
else | |
N=$(basename $(pwd))-$$ | |
echo $N > .dockername | |
fi |
This file contains hidden or 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 | |
SUBREDDIT=${SUBREDDIT-"$1"} | |
OUTDIR=${OUTDIR-"/tmp/subreddit-posts/$SUBREDDIT/$$"} | |
OUTALL="${OUTDIR}/postset-all.json" | |
if [ ! "$SUBREDDIT" ] | |
then | |
echo "Must Define SUBREDDIT" | |
exit 1 |
This file contains hidden or 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 | |
import matplotlib as plt | |
import pandas as pd | |
import sys | |
import os | |
outname = "/tmp/plot-columns-{}.png".format(os.getpid()) | |
infile = None |
This file contains hidden or 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 FlexibleContexts #-} | |
import Lens.Micro | |
import Lens.Micro.Mtl | |
import Lens.Micro.Internal | |
import Control.Applicative | |
loebl :: Each s a (a -> b) b => s -> a | |
loebl x = go where go = over each ($ go) x |
This file contains hidden or 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/sh | |
set -e | |
# Options with defaults | |
SCRIPT_ARGS="$*" | |
MIGRATION_DIR=${MIGRATION_DIR-'migrations'} | |
MIGRATION_TABLE=${MIGRATION_TABLE-'migrations'} | |
MIGRATION_COMMAND=${MIGRATION_COMMAND-'psql'} |
This file contains hidden or 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
-- Clustering algorithm v2 | |
destroy _ E = E | |
destroy 1 (L _) = E | |
destroy _ (L x) = L x | |
destroy n x@(N l r) | count x == n = E | |
| count x > n = N (destroy n l) (destroy n r) | |
| otherwise = x | |
search _ E = [] |