Skip to content

Instantly share code, notes, and snippets.

View qxjit's full-sized avatar

David Vollbracht qxjit

  • Flipstone Technology Partners, Inc
View GitHub Profile
@qxjit
qxjit / stack-output.text
Created December 15, 2022 17:08
Verbose output of `stack repl` not respecting `default-language`
Version 2.9.1, Git revision 409d56031b4240221d656db09b2ba476fe6bb5b1 x86_64 hpack-0.35.0
2022-12-15 11:06:14.483184: [debug] Checking for project config at: /home/qxjit/work/heb/stack-bug-test/stack.yaml
2022-12-15 11:06:14.483328: [debug] Loading project config file stack.yaml
2022-12-15 11:06:14.486134: [debug] (SQL) SELECT COUNT(*) FROM "last_performed" WHERE ("action"=?) AND ("timestamp">=?); [PersistInt64 1,PersistUTCTime 2022-12-14 17:06:14.486109085 UTC]
2022-12-15 11:06:14.486406: [debug] Using package location completions from a lock file
2022-12-15 11:06:14.487679: [debug] Loaded snapshot from Pantry database.
2022-12-15 11:06:14.644524: [debug] Running hpack on /home/qxjit/work/heb/stack-bug-test/package.yaml
2022-12-15 11:06:14.646648: [debug] hpack output unchanged in /home/qxjit/work/heb/stack-bug-test/stack-bug-test.cabal
2022-12-15 11:06:14.646781: [debug] Prefetching git repos: []
2022-12-15 11:06:14.646803: [debug] []
@qxjit
qxjit / StockLiquorT.hs
Created April 15, 2020 21:19
StockLique Monad Transformer
{-
Goal:
- Recover from OverpricedDrinkErrors and continue charging for drinks
- Simulate a NetworkError
- Use finally to ensure the CreditCardAPIConnection is closed in the event
of an error
-}
module StockLiquorT where
@qxjit
qxjit / StockLiquor.hs
Created April 1, 2020 21:23
StockLiquore State monad
{-
Goal: Turn this bar into a liquor stock market
## Add Feature
- Get prices from the a market
- define the market
- pass it through everywhere
- Adjust the market based on orders
@qxjit
qxjit / RelationalMapExample.hs
Created September 19, 2018 18:43
A simple example of mapping a Haskell field to multiple columns in Orville
module RelationalMapExample where
import qualified Data.Int as Int
import qualified Data.Text as Text
import qualified Database.Orville as O
data Update key = Update
{ updateId :: key
, updateLocation :: Text.Text
@qxjit
qxjit / keybase.md
Created June 4, 2018 17:07
keybase.md

Keybase proof

I hereby claim:

  • I am qxjit on github.
  • I am qxjit (https://keybase.io/qxjit) on keybase.
  • I have a public key ASCALGoHUAO-MjrvhbXp6a4UHaKnvz1x62r6Z70FYIh6RAo

To claim this, I am signing this object:

@qxjit
qxjit / calculator.html
Created April 16, 2015 00:43
NOBO Coders Meetup Calculator
<html>
<head>
<style type="text/css">
body {
width: 966px;
margin: auto;
background-color: gray;
}
.button-section {
@qxjit
qxjit / multilineLet.fsx
Created October 1, 2014 18:27
multiline let which is a value, not a function
let f x =
let a =
let c = 2
let d = 3
c + d*x
a + a
printfn "%d" (f 1)
@qxjit
qxjit / comp.rb
Created June 27, 2014 21:05
Ruby proc & symbol composition
def comp(*gs)
id = -> x { x }
gs.inject(id) do |f,g|
-> x do
f.to_proc.call g.to_proc.call x
end
end
end
times_2 = -> x { x * 2 }
@qxjit
qxjit / gist:2de9409c40c605c77182
Last active August 29, 2015 14:03
Cthulhu Voice Procedure Alphabet
Letter Word
A Azathoth
B B’gnu-Thun
C Cthulhu
D D’endrrah
E Ei'lor
F Fhtagn
G Gi-Hoveg
H Hastur
@qxjit
qxjit / romeo.idr
Created May 2, 2014 17:32
Romeo & Juliet made safe
data Health = JustFine | LooksDead | IsDead
record Character : Type where
MkCharacter : (name:String) ->
(health:Health) ->
Character
instance Show Health where
show IsDead = "is dead"
show LooksDead = "looks dead"