Skip to content

Instantly share code, notes, and snippets.

@tkuriyama
tkuriyama / Emacspeak_OSX_installation_instructions.sh
Created May 30, 2022 18:41 — forked from AmandaKLacy/Emacspeak_OSX_installation_instructions.sh
Instructions for setting up Emacspeak on the Mac.
### Step-by-step terminal instructions to install emacspeak on OS X.
### Note by Amanda Lacy
### This file is based on the set of instructions at this link:
### https://gist.github.com/izahn/cd784303663083ee2c95
### Also, thanks to Haden Pike, Tyler Littlefield, David Tseng and others on the Program-L list for their extra tips on Emacspeak settup.
### Those extra steps are at the botom of this file.
### End note
### If you are feeling lucky you can copy and paste this whole file into
@tkuriyama
tkuriyama / Eratosthenes.elm
Created October 30, 2021 16:28
Elm Eratosthenes
module Examples.Eratosthenes exposing (..)
{-| Sieve of Eratosthenes examples.
See <https://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf> for further details on the algorithms.
-}
import Dict
import Generator as G
@tkuriyama
tkuriyama / setup-js2.el
Last active September 2, 2021 14:11
initial setup for js2 mode in emacs
(use-package js2-mode
:ensure t
:mode
(("\\.m?js\\'" . js2-mode))
:config
(add-hook 'js2-mode-hook
(lambda () (interactive) (column-marker-1 80)))
;; Better imenu
(setq js2-mode-show-parse-errors nil)
(setq js2-mode-show-strict-warnings nil)
@tkuriyama
tkuriyama / pcap_sample.org
Last active January 7, 2021 16:08
PCAP_Sample_Deconstruction
@tkuriyama
tkuriyama / RiskTable.txt
Created September 17, 2020 15:36
Risk Win Probabilities
Win probabiloity for A
A: 1 B: 1 | Sim: < 0.1% | Exact: < 0.1% | Diff: < 0.1% | Exact: 0 % 1
A: 1 B: 2 | Sim: < 0.1% | Exact: < 0.1% | Diff: < 0.1% | Exact: 0 % 1
A: 1 B: 3 | Sim: < 0.1% | Exact: < 0.1% | Diff: < 0.1% | Exact: 0 % 1
A: 1 B: 4 | Sim: < 0.1% | Exact: < 0.1% | Diff: < 0.1% | Exact: 0 % 1
A: 1 B: 5 | Sim: < 0.1% | Exact: < 0.1% | Diff: < 0.1% | Exact: 0 % 1
A: 1 B: 6 | Sim: < 0.1% | Exact: < 0.1% | Diff: < 0.1% | Exact: 0 % 1
A: 1 B: 7 | Sim: < 0.1% | Exact: < 0.1% | Diff: < 0.1% | Exact: 0 % 1
A: 1 B: 8 | Sim: < 0.1% | Exact: < 0.1% | Diff: < 0.1% | Exact: 0 % 1
A: 1 B: 9 | Sim: < 0.1% | Exact: < 0.1% | Diff: < 0.1% | Exact: 0 % 1
@tkuriyama
tkuriyama / cis_194_hw12.hs
Last active September 17, 2020 15:15
Game of Risk
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Risk where
import Control.Monad.Random
import Control.Applicative
import Data.List (sort, group)
import qualified Data.Map as M (fromList, Map, lookup)
import Data.Ratio
@tkuriyama
tkuriyama / cis_194_hw11.hs
Created September 15, 2020 16:13
CIS 194 Week 11
module SExpr where
import AParser
import Control.Applicative
import Data.Char
------------------------------------------------------------
-- 1. Parsing repetitions
------------------------------------------------------------
@tkuriyama
tkuriyama / cis_194_hw10.hs
Last active September 13, 2020 20:08
CIS 194 Week 10
module AParser where
import Control.Applicative
import Data.Char
newtype Parser a = Parser { runParser :: String -> Maybe (a, String) }
satisfy :: (Char -> Bool) -> Parser Char
satisfy p = Parser f
where
@tkuriyama
tkuriyama / tcrstuff.sh
Last active September 11, 2020 19:38
TCR Stuff
# watch.sh using fswatch on macOS
while true
do
fswatch -r --one-event -e modify ./src
./tcr.sh
done
# commit.sh using AppleScript to create a GUI prompt
MESSAGE=$(osascript -e 'text returned of (display dialog "eEter commit message" default answer "TCR autocommit")')
git commit -am "$MESSAGE"
@tkuriyama
tkuriyama / cis_194_hw8.hs
Last active September 10, 2020 02:18
CIS 194 HW8
-- {-# OPTIONS_GHC -fno-warn-orphans #-}
module Party where
import Data.Semigroup
import Data.Tree
import Data.Function (on)
import Data.List (sortBy)
import Employee