Skip to content

Instantly share code, notes, and snippets.

View afldcr's full-sized avatar

Alex Feldman-Crough afldcr

View GitHub Profile
@afldcr
afldcr / Arrays.md
Last active August 29, 2015 14:22
A *better* JavaScript data structure.

Turns out, all you need is a list!

(Oh god what have I done.)

enc('Hello world');

// Output: [[[],[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]],[[],[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]],[[],[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]],[[],[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]],[[],[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[

@afldcr
afldcr / xmonad_max.fish
Created July 6, 2015 22:34
Install xmonad, xmonad-contrib, and xmobar in OS X
#!/bin/fish
# this assumes that ~/.local/xmonad/bin is a part of your $PATH
function xmonad_mac
# enforce OSX
if [ (uname) != 'Darwin' ]
echo "This is an OSX specific script. Aborted"
return 1
end;
# set up the build enviornment in /tmp
@afldcr
afldcr / FunctorSet.hs
Last active June 19, 2016 23:14
Sets can be a functor in Haskell, too. They just aren't.
{-# LANGUAGE RankNTypes #-}
import Control.Monad.State (State, gets, put)
import Data.Set (Set)
import qualified Data.Set as S
newtype SetF a =
SetF (forall x. Ord x => (a -> x) -> Set x)
instance Ord a => Eq (SetF a) where
### Keybase proof
I hereby claim:
* I am crough on github.
* I am crough (https://keybase.io/crough) on keybase.
* I have a public key whose fingerprint is 2ED9 A801 85E0 2F8D 68D4 E933 944A F873 4AB4 7315
To claim this, I am signing this object:
@afldcr
afldcr / afldcr.asc
Created November 8, 2016 19:49
PGP Identity
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQINBFgiFxMBEADP0/hrRv+sVfSQB8Ylzvor3N3Awpy6cDnBeOnzAwt7HDnWYlcO
H1zm5+tGsWyXAhgEEk+VMDoLPVstTFzoROw4M02EiptEM/14qJWmGEF/5agkL/gt
WVWF5l4RWxGHH4zpaoN1M5hiKnoNpInUDArQi+VJB/YCaugoo9KXiiX0YexcJzMl
zKf0F259EMlpeEw90mdmVtYqPlrbiFR8By6xX/j/sSpyKLkT/XvT/Gc0I/bk8Vt3
PgML542Zka8lADgtz840dpvrkZHqJ6Q8cBHk41beDctpv/0DdZx6Ktnmlc9EFO29
oWrOOIY5vuyL3rp2jinnCTMB20WDugDttVKYgFiCM9BPwnB7eBAJmRL8QmwpSaQu
IhEEzfjSNcOWfmaKH6zKcHlQ8SoKFK8w5y9Fer9AqR9U8Pp3T8QYhA6h29A2UAhj
@afldcr
afldcr / DoubleCont.hs
Created April 12, 2018 16:04
Double continuations?
{-# LANGUAGE ApplicativeDo #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RankNTypes #-}
import Control.Applicative (WrappedMonad(..))
import Data.Profunctor
import Data.Functor.Apply
import Data.Functor.Bind
newtype Circa f g a b i o =