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
| # for long running commands | |
| function try () { | |
| bloohm "/dev/ttyACM0" Yellow $PWD:A "$*" | |
| time $* && fin || die; # cargo install tally, replacement for time | |
| } | |
| function play_sound () { | |
| aplay -N -q $HOME/.bin/$1.au | |
| } |
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 time | |
| import board | |
| import busio | |
| import adafruit_trellism4 | |
| import adafruit_adxl34x | |
| import supervisor | |
| # Set up Trellis and accelerometer | |
| trellis = adafruit_trellism4.TrellisM4Express(rotation=0) | |
| i2c = busio.I2C(board.ACCELEROMETER_SCL, board.ACCELEROMETER_SDA) |
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
| Host * | |
| ServerAliveInterval 15 | |
| ServerAliveCountMax 3 | |
| ControlMaster auto | |
| ControlPath ~/.ssh/ssh-%h-%p-%r | |
| ConnectionAttempts 2 | |
| ForwardAgent yes | |
| ControlPersist 2m |
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 time | |
| import board | |
| import busio | |
| import adafruit_trellism4 | |
| import adafruit_adxl34x | |
| import supervisor | |
| # Set up Trellis and accelerometer | |
| trellis = adafruit_trellism4.TrellisM4Express(rotation=0) | |
| i2c = busio.I2C(board.ACCELEROMETER_SCL, board.ACCELEROMETER_SDA) |
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
| # for long running commands | |
| function try () { | |
| tally $* && fin || die; # cargo install tally, replacement for time | |
| } | |
| function play_sound () { | |
| afplay $HOME/.bin/$1.wav | |
| } | |
| function notify_success() { |
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
| \documentclass{article} | |
| \usepackage[margin=1.5in]{geometry} | |
| \usepackage{fancyhdr} | |
| %include lhs2TeX.fmt | |
| %include lhs2TeX.sty | |
| \pagestyle{fancy} | |
| \lhead{\footnotesize November 1 2012} | |
| \rhead{\footnotesize CS410W -- Word Frequency Count in Haskell -- Shae Erisson} | |
| \begin{document} | |
| \section*{Word frequency count in Haskell} |
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
| {-# LANGUAGE DeriveGeneric #-} | |
| {-# LANGUAGE DerivingStrategies #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE QuasiQuotes #-} | |
| {-# LANGUAGE TemplateHaskell #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| module Main where | |
| import Data.ByteString.Lazy.Char8 (ByteString) |
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
| all the fio commands from https://askubuntu.com/a/991311/2598 | |
| with one of two drives in my laptop: | |
| samsung 970 pro | |
| READ: bw=3295MiB/s (3455MB/s), 3295MiB/s-3295MiB/s (3455MB/s-3455MB/s), io=10.0GiB (10.7GB), run=3108-3108msec | |
| WRITE: bw=2530MiB/s (2653MB/s), 2530MiB/s-2530MiB/s (2653MB/s-2653MB/s), io=10.0GiB (10.7GB), run=4048-4048msec | |
| READ: bw=55.3MiB/s (57.9MB/s), 55.3MiB/s-55.3MiB/s (57.9MB/s-57.9MB/s), io=3316MiB (3477MB), run=60001-60001msec | |
| READ: bw=624KiB/s (639kB/s), 624KiB/s-624KiB/s (639kB/s-639kB/s), io=36.6MiB (38.4MB), run=60004-60004msec | |
| WRITE: bw=624KiB/s (639kB/s), 624KiB/s-624KiB/s (639kB/s-639kB/s), io=36.5MiB (38.3MB), run=60004-60004msec | |
| samsung 970 evo plus |
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
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| module Main where | |
| import Data.Aeson | |
| import qualified Data.ByteString.Lazy as BSL | |
| import qualified Data.Text as T | |
| main :: IO () |
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
| -- | given a directory for a paper, read that json file into a Paper value | |
| readPaper :: FilePath -> IO (Maybe Paper) | |
| readPaper fp = do | |
| f <- findPaper fp "paper.json" | |
| let f' = listToMaybe f | |
| bs <- mapM BS.readFile f' -- XXX this gonna be a problem at some point XXX | |
| mapM decodeStrict bs -- is this right? do I need this pure? can I concat it with the previous line? |