Skip to content

Instantly share code, notes, and snippets.

View eborden's full-sized avatar
💙

Evan Rutledge Borden eborden

💙
View GitHub Profile
@eborden
eborden / CompactFail.hs
Created August 24, 2017 16:36
Compaction failing on an existential type carrying a type class dict
#!/usr/bin/env stack
-- stack --resolver nightly-2017-08-20 --install-ghc runghc --package compact
{-# LANGUAGE ExistentialQuantification #-}
module Main where
import Data.Compact
class SomeClass a where
someId :: a -> a
@eborden
eborden / Main.hs
Last active September 26, 2017 15:39
Benchmark various folding averages
module Main (main) where
import qualified Control.Foldl as Fold
import Criterion.Main
import qualified Data.List
import Data.Maybe
import Data.Semigroup
naiveAvg, foldMapAvg, foldlAvg, foldAvg :: [Float] -> Float
naiveAvg xs = Prelude.sum xs / fromIntegral (Prelude.length xs)
@eborden
eborden / Chans.hs
Created October 13, 2017 01:19
Immortal chans
#!/usr/bin/env stack
-- stack --resolver lts-9.8 script
module Main where
import Data.Functor (void)
import Data.Foldable (traverse_, for_)
import Data.Traversable (for)
import Control.Concurrent (forkIO, readChan, writeChan, newChan, getNumCapabilities)
import Control.Immortal (create, wait, Thread)
@eborden
eborden / stretch.service
Last active November 8, 2017 22:51
Insecure stretching reminder using giphy, jq and systemd timers
[Unit]
Description=Stretching Reminder
[Service]
User=username
Environment=DISPLAY=:0
Type=oneshot
ExecStart=/path-to/stretch.sh
@eborden
eborden / AVerbalArithmetic.hs
Last active March 9, 2018 20:44
A brute force solution to verbal arithmetic
import Control.Monad (guard)
import Data.Bifunctor (second)
import Data.Foldable (for_, traverse_)
import Data.List (nub, permutations, unwords)
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Maybe (fromMaybe)
test :: IO ()
$ ./take-throw-test.hs
with
m
...
with
m
with
m
with
m
@eborden
eborden / stack-ghcid.sh
Last active May 16, 2019 14:43
Run ghcid in a monorepo via stack
project=$(basename "$(pwd)")
# build dependencies
build_deps="stack build $project --fast --pedantic --dependencies-only --interleaved-output"
# restart on changes in other packages
restarts=$(find ../. -maxdepth 1 -type d \
-not -name "$project" \
-not -name .stack-work \
-not -name . \
@eborden
eborden / FreshVar.hs
Last active September 24, 2019 22:41
Shared values that always stay fresh
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NamedFieldPuns #-}
module Control.Concurrent.FreshVar
( FreshVar
, newFreshVar
, newPreemptiveFreshVar
, readFreshVar
)
@eborden
eborden / scrum-vs-kanban.md
Created May 5, 2020 01:40
scrum vs Kanban

IMHO, Kanban and SCRUM attempt to achieve the same goal, throughput. However they put systemic pressure on different points of organizational breakdown.

SCRUM takes the stance that communication is where throughput suffers. Without effective communication, via iterative planning, efficiency is lost.

Kanban believes focus is the point of efficiency loss. By moving tasks through work limited stages a team gains laser focus which should encourage high throughput.

That doesn't mean that SCRUM doesn't value focus. It utilizes story points and velocity to encourage tightly focused iterations.

Nor does Kanban ignore communication. Boards communicate work status and well designed work in progress limits on your board should encourage communication and collaboration amongst team members.