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 ruby | |
unless ARGV[0] | |
puts 'Usage: newpost "the post title"' | |
exit(-1) | |
end | |
jekyll_site_prefix = "." | |
editor = "open -a Byword" | |
date_now = Time.now |
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
#!/bin/sh | |
DESTDIR="$HOME/workspace" | |
ACTIVATE="$DESTDIR/erlang/activate" | |
mkdir -p "$DESTDIR" | |
cd "$DESTDIR" | |
# get dependencies | |
sudo apt install autoconf libncurses-dev build-essential libssl-dev m4 |
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
### Keybase proof | |
I hereby claim: | |
* I am tnull on github. | |
* I am tnull (https://keybase.io/tnull) on keybase. | |
* I have a public key whose fingerprint is FADE EF4A 1161 B73D 852C C16E 4DDE 50E8 1D58 58C3 | |
To claim this, I am signing this object: |
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 qualified Options.Applicative as OA | |
data AppArgs = | |
AppArgs | |
{ inFilePath :: !String | |
, outFilePath :: !String | |
, sampleFilter :: !Int | |
} | |
deriving (Show) |
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
data OwnRecord = OwnRecord { key :: String | |
, testList :: [Float] | |
} | |
testMap :: String -> [Float] -> M.Map String OwnRecord | |
testMap s fs = foldl (\acc x -> M.insertWith update s x acc) M.empty fs | |
where | |
update (OwnRecord s newList) (OwnRecord s oldList) = OwnRecord s (oldList ++ newList) |
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
let mut paths_cached = payment_paths.clone(); | |
let instant_cached = Instant::now(); | |
paths_cached.sort_by_cached_key(|path| path.get_total_fee_paid_msat()); | |
println!("Cached sort took: {}", instant_cached.elapsed().as_nanos()); | |
let mut paths_unstable = payment_paths.clone(); | |
let instant_unstable = Instant::now(); | |
paths_unstable.sort_unstable_by_key(|path| path.get_total_fee_paid_msat()); | |
println!("Unstable sort took: {}", instant_unstable.elapsed().as_nanos()); |