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
import Control.Concurrent (forkIO, killThread, | |
threadDelay, newEmptyMVar, | |
tryTakeMVar, putMVar) | |
import Control.Monad (void, forever) | |
import Control.Concurrent.STM (atomically) | |
import Control.Monad.Trans (MonadIO(..)) | |
import Control.Monad.Trans.Resource (MonadResource, allocate) | |
import Data.Conduit (GInfConduit, awaitE) | |
throttle :: (MonadResource m) => Int -> GInfConduit a m a |
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 | |
BIN=$1 | |
[[ -n $BIN ]] || BIN=xmonad | |
stack install --local-bin-path $PWD | |
[[ -f $BIN ]] || ln -s xmonad $BIN |
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
# This isn't meant to be ran as a script, but line-by-line | |
# Props to Binary (benary.org) for helping me with this | |
# 0: Create a Scaleway instance and SSH into it | |
ssh root@... | |
# 1: Install Nix | |
adduser user # set a password, doesn't matter what because it's not staying long | |
adduser user sudo | |
su -l user |
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 | |
# Update: As of March 24th 2017 this script won't work. | |
# The script at https://get.haskellstack.org/ is broken | |
# because the binary of Stack 1.4 for ARM is missing from https://www.stackage.org/stack/ . | |
# You can still get the binary for Stack 1.3.2 from | |
# https://github.com/commercialhaskell/stack/releases/download/v1.3.2/stack-1.3.2-linux-arm.tar.gz | |
# and place it at $USR_LOCAL_BIN/stack in your system. | |
# Once Stack is installed you can proceed with the Install LLVM step |
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 | |
# Reproduce "load command size" panic on MacOS High Sierra | |
# $ sh genpanic.sh | |
# $ cd panic | |
# $ stack build panic | |
mkdir panic | |
cd panic |