This file contains 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 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 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 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 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 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 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? |
This file contains 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
module Main where | |
import Web.Scotty | |
main :: IO () | |
main = do | |
scotty 3000 $ do | |
get "/foo%2C" $ html "you got the url encoded option" | |
get "/foo," $ html "you got the NOT YET url encoded option" |
This file contains 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
;; haskell | |
(use-package haskell-mode | |
:ensure t | |
:init | |
(progn | |
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode) | |
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent) | |
(add-hook 'haskell-mode-hook 'interactive-haskell-mode) | |
(setq haskell-process-args-cabal-new-repl | |
'("--ghc-options=-ferror-spans -fshow-loaded-modules")) |
This file contains 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
;;; orgtimer.el --- show org-agenda when emacs is idle for five minutes | |
;;; stolen directly from https://www.emacswiki.org/emacs/IdleTimers | |
;; variable for the timer object | |
(defvar idle-timer-org nil) | |
;; callback function | |
(defun idle-timer-org-callback () | |
(org-agenda-list)) |