Skip to content

Instantly share code, notes, and snippets.

View peterbecich's full-sized avatar

Peter Becich peterbecich

View GitHub Profile
@asivitz
asivitz / genpanic.sh
Last active March 6, 2018 06:22
A bash script to generate giant stack project with many sub-packages to reproduce the "load commands size" panic on High Sierra
#!/bin/bash
# Reproduce "load command size" panic on MacOS High Sierra
# $ sh genpanic.sh
# $ cd panic
# $ stack build panic
mkdir panic
cd panic
@tmspzz
tmspzz / install-haskell-stack-arm.sh
Last active April 28, 2019 07:00
A scrip to install Haskell Stack and set up things properly on Raspbian
#!/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 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
@Philonous
Philonous / build
Last active April 7, 2019 06:52
Xmonad rebuild script
#!/bin/bash
BIN=$1
[[ -n $BIN ]] || BIN=xmonad
stack install --local-bin-path $PWD
[[ -f $BIN ]] || ln -s xmonad $BIN
@roman
roman / throttle.hs
Last active December 7, 2017 05:50
Implementation of throttle in Conduit 0.5.x
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