Skip to content

Instantly share code, notes, and snippets.

Simon Michael simonmichael

Block or report user

Report or block simonmichael

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@simonmichael
simonmichael / a.txt
Created Jan 31, 2019
hledger commands list 20190131
View a.txt
$ hledger
-------------------------------------------------------------------------------
hledger 1.12.99
Usage: hledger COMMAND [OPTIONS] [-- ADDONCMDOPTIONS]
Commands (+ addons found in $PATH):
Data entry (these commands modify the journal file):
add add transactions using guided prompts
+iadd add transactions using curses ui
View gist:9b209b192de2ba79232475a50fdc0061
case () of
_ | changes==movedown -> printf "%d,%dv " x y
_ | changes==moveleft -> printf "<%d,%d " x y
_ | changes==moveright -> printf "%d,%d> " x y
_ -> printf "%d,%d. " x y
@simonmichael
simonmichael / a.hs
Created Dec 10, 2018
parsing with scanf
View a.hs
parsePoints s = s
& lines
& map (SC.scanf [SC.fmt|position=<%d, %d> velocity=<%d, %d>|])
& catMaybes
& map (SC.printf [SC.fmt|((%d,%d), (%d,%d))|])
& map read :: [Point]
@simonmichael
simonmichael / wellsfargo.hs
Last active Jan 19, 2019
A WIP Wells Fargo bank scraper in haskell that I couldn't get working reliably (2016). If you do, please let me know!
View wellsfargo.hs
#!/usr/bin/env stack
{- stack exec
--verbosity info
--package webdriver
-- ghc
-}
--package data-default
-- stack exec ghci wellsfargo
-- stack exec ghc wellsfargohs
--
@simonmichael
simonmichael / Makefile.linux
Last active Nov 5, 2018
darcs record speed test scripts
View Makefile.linux
# Makefile.linux
# The mac makefile is more up to date.
TIME=/usr/bin/time -f%E
DARCS=darcs
test:
for N in \
100 200 300 400 500 600 700 800 900 \
1000 2000 3000 4000 5000 6000 7000 8000 9000 \
@simonmichael
simonmichael / 1 event log
Created Oct 28, 2018
intellij-haskell beta 30 errors on restarting REPLS
View 1 event log
10:08 AM Restarting Haskell project
10:09 AM [global-stack-repl] Stack REPL will be started with command: /Users/simon/.local/bin/stack repl --with-ghc intero --no-load --no-build --ghci-options -ghci-script=/Users/simon/Library/Caches/com.github.rikvdkleij.intellij-haskell/repl.ghci --silent --ghc-options -v1 --no-package-hiding --test --bench
10:09 AM [global-stack-repl] Stack REPL is started
10:09 AM [global-stack-repl] Command :q took + 7 ms
10:09 AM [global-stack-repl] stdout: Leaving GHCi.
@simonmichael
simonmichael / 1 event log
Created Oct 28, 2018
intellij-haskell beta 30 intero build error
View 1 event log
9:23 AM Executing `/Users/simon/.local/bin/stack build intero --fast` failed: /Users/simon/.local/bin/stack build intero --fast:
WARNING: Ignoring out of range dependency (allow-newer enabled): ghc-8.6.1. intero requires: >=7.8 && <=8.4.3
intero-0.1.32: download
intero-0.1.32: configure
intero-0.1.32: build
-- While building package intero-0.1.32 using:
/Users/simon/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.1 --builddir=.stack-work/dist/x86_64-osx/Cabal-2.4.0.1 build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
Logs have been written to: /Users/simon/src/PLAINTEXTACCOUNTING/hledger2/.stack-work/logs/intero-0.1.32.log
Configuring intero-0.1.32...
@simonmichael
simonmichael / get-google-sheet-csv.hs
Created Oct 28, 2018
get-google-sheet-csv.hs - stack script to fetch google sheets as CSV
View get-google-sheet-csv.hs
#!/usr/bin/env stack
{- stack --resolver=lts-9.21 script --compile
--package "bytestring cassava gogol gogol-core gogol-sheets lens pretty-show text"
--verbosity=info
-}
{-
INSTALL:
Get stack if needed, eg from https://haskell-lang.org/get-started
Run "get-google-sheet-csv.hs" once to compile. On Windows, run "stack get-googlesheet-csv.hs".
View analyze.js diff.txt
ledger-analytics$ git diff analyze.js
diff --git a/analyze.js b/analyze.js
index 09a98dd..34eefcd 100644
--- a/analyze.js
+++ b/analyze.js
@@ -2,7 +2,7 @@ const util = require('util')
const exec = util.promisify(require('child_process').exec)
module.exports.getCommodities = async (file) => {
- const { stdout } = await exec('ledger -f ' + file + ' commodities')
You can’t perform that action at this time.