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
packageOverrides = super: { | |
haskellPackages = super.haskellPackages.override { | |
overrides = { | |
some-pkg = pkgs.haskell.lib.overrideCabal super.some-pkg (orig: { | |
src = fetchFromGithub {}; | |
}); | |
}; | |
}; |
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
#! /usr/bin/env nix-shell | |
#! nix-shell -i racket -p racket | |
#lang racket | |
(require racket/pretty) | |
(define (pretty-write-all) | |
(define next (read)) | |
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
#!/usr/bin/env stack | |
{- stack script --nix --resolver lts-10.9 | |
--package streaming | |
--package amazonka | |
--package amazonka-s3 | |
--package amazonka-core | |
--package bytestring | |
--package resourcet | |
--package conduit | |
--package conduit-combinators |
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
name | age | interest | age2 | age3 | |
---|---|---|---|---|---|
bill | 29 | bitcoin | 29 | 29 | |
vanessa | 33 | wine | 33 | 33 |
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
1..4 | |
ok 1 - scalar division | |
ok 2 - scalar multiplication | |
not ok 3 - multiply 1 BTC to the smallest unit | |
# | |
# got '0 msat', expected '1 msat' | |
# | |
ok 4 - lots of msats |
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
#!/usr/bin/env bash | |
PANDOC="pandoc --variable urlcolor=cyan" | |
usage () { | |
printf "usage: pdfnow file.md OR <file.md pdfnow markdown\n" >&2 | |
exit 1 | |
} | |
[ $# -eq 0 ] && usage |
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
#!/usr/bin/env bash | |
howlong() { | |
mins=$(($1 * 10)) | |
target=$(date -u -d "now + $mins minutes" -Iseconds) | |
targetp=$(date -d $target '+%F %R %Z') | |
ddiff=$(datediff -f "%dd %Hh %0Mm @ $targetp" "now" "$target") | |
printf "%s\n" "$ddiff" | |
} |
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
#!/usr/bin/env bash | |
getprice () { | |
# replace with your preferred exchange | |
curl -sL 'https://api.quadrigacx.com/v2/ticker' | jq -r .last | |
} | |
n=${1:-100} | |
size=${2:-226} | |
price=${3:-$(getprice)} |
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
enum opcode_token | |
{ | |
// push value | |
_OP_0=1, | |
_OP_FALSE, | |
_OP_PUSHDATA1, | |
_OP_PUSHDATA2, | |
_OP_PUSHDATA4, | |
_OP_1NEGATE, | |
_OP_RESERVED, |
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
#!/usr/bin/env bash | |
set -e | |
access_token=$GITHUB_ACCESS_TOKEN | |
api() { | |
curl -sL -H "Authorization: token $access_token" "$@" | |
} |