I hereby claim:
- I am hrldcpr on github.
- I am harold (https://keybase.io/harold) on keybase.
- I have a public key ASAPWKbiomRFjYfOwBXs914vgEEbl3rgCRofGekEWGPzUQo
To claim this, I am signing this object:
import collections | |
from typing import Counter, List, Set, Tuple | |
def subanagrams(letters: Counter[str], words: Set[str], min_len=4) -> List[Tuple[str, Counter[str]]]: | |
anagrams = [] | |
for word in words: | |
if len(word) < min_len: continue | |
rest = letters.copy() |
import asyncio | |
import aiofiles # third party package, install from pip | |
# bytes outputted by the imaginary joystick device: | |
CENTER = b'x' | |
NORTH = b'n' | |
EAST = b'e' | |
SOUTH = b's' |
// We have some state like: | |
const state1 = { | |
data: { some: 'stuff' }, | |
people: ['blah', 'blah', 'blah'], | |
memberships: [ | |
{ id: 1, roles: [], other: 'stuff' }, | |
{ id: 2, roles: ['client'], more: 'junk' } | |
] | |
}; |
// We have some state like: | |
const state1 = { | |
data: { some: 'stuff' }, | |
people: ['blah', 'blah', 'blah'], | |
memberships: [ | |
{ id: 1, roles: [], other: 'stuff' }, | |
{ id: 2, roles: ['client'], more: 'junk' } | |
] | |
}; |
I hereby claim:
To claim this, I am signing this object:
import collections | |
class LinkedList: | |
def __init__(self, value, tail=None): | |
self.value = value | |
self.tail = tail | |
def tee(iterable, n=2): | |
it = iter(iterable) | |
empty = LinkedList(None) |
import Control.Monad.Reader | |
import Control.Monad.Trans | |
import Data.List | |
import Data.Maybe | |
import Text.Printf | |
type Environment = [(String, String)] | |
get :: String -> ReaderT Environment Maybe String |
liftM f m = m >>= (return . f) | |
liftM f m = do | |
a <- m | |
return (f a) | |
-- which is just sugar for: | |
liftM f m = | |
m >>= \a -> |
First, install VirtualBox. Then:
brew update
brew upgrade
brew install docker boot2docker
mkdir ~/.boot2docker
curl http://static.dockerfiles.io/boot2docker-v1.1.2-virtualbox-guest-additions-v4.3.12.iso \
> ~/.boot2docker/boot2docker.iso
import qualified Data.Maybe as Maybe | |
import qualified Control.Monad.Reader as Reader | |
type Environment = [(String, String)] | |
get :: String -> Environment -> String | |
get k env = Maybe.fromJust $ lookup k env |