Skip to content

Instantly share code, notes, and snippets.

🏳️‍🌈
Breaking things

Noel Cower nilium

🏳️‍🌈
Breaking things
Block or report user

Report or block nilium

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
@nilium
nilium / 1p-NOTICE.md
Last active Jan 12, 2019
A CLI tool to fuzzy-find 1Password vault items and copy / format them.
@nilium
nilium / fup
Last active Jan 6, 2019
Short script to upload a file to a GCS bucket and print its public URL
View fup
#!/usr/bin/env bash
prog="$(basename "$0")"
## Defaults
# : ${FUP_BUCKET:=YOUR-BUCKET}
# : ${FUP_URL_PREFIX:=https://CUSTOM-URL/}
: ${FUP_PAR_UPLOAD_THRESHOLD:=100M}
: ${FUP_URL_PREFIX:=https://storage.googleapis.com/${FUP_BUCKET}/}
View messages.go
// This is an example message reader/writer with length prefixes and digests
// (in the example's case, using hmac-sha1) to try to confirm that the entire
// correct message was read.
package main
import (
"bytes"
"crypto/hmac"
"crypto/sha1"
View keybase.md

Keybase proof

I hereby claim:

  • I am nilium on github.
  • I am nilium (https://keybase.io/nilium) on keybase.
  • I have a public key ASA9ZYQ-ovUYaqBiWNB9MPYWyy-cDcIQZym8orvks3qGvAo

To claim this, I am signing this object:

View zshasum
#!/usr/bin/env bash
args=()
while [ $# -gt 0 ]; do
case "$1" in
--) shift; break;;
-?*) :;;
-) break;;
*) break;;
esac
@nilium
nilium / agentr
Last active Aug 31, 2018
Lazy script to run ag and entr in conjunction with a series of commands.
View agentr
#!/usr/bin/env bash
prog="$(basename "$0")"
want() {
for bin; do
if ! hash "$bin" 1>/dev/null 2>&1; then
echo "$bin: not installed" 1>&2
exit 1
fi
@nilium
nilium / codf.md
Last active Jul 9, 2018
Codf rationale draft 2
View codf.md

Codf exists primarily to make expressive, structured configuration easy to use. Expressive in this case means, more or less, relatively complex but easy to read and write. There are cases of progams like this in the wild, such as nginx, where configuration is integral to making use of them. Codf takes inspiration from nginx in particular, along with other curly-braced config languages. The goal is to provide structure for programs where the status quo of JSON-equivalent languages do not.

With that in mind, codf is the result of several years of building programs that require configuration to define their runtime behavior. This includes several programs whose configuration borders on scripting. These programs need configuration not only for inputs (sockets, files, DBs) and outputs (metrics, logs, more DBs), but also tasks, schedules, data pipelines, state transitions, and so on. Without these, the programs are mostly inert and do nothing — this makes configuration crucial to

@nilium
nilium / codf.md
Last active Jul 8, 2018
Codf rationale draft
View codf.md

Codf

codf (godoc) is a personal config language for declaring structured config files with support for a range of built-in types. It's meant to scratch an itch I've had over configuration in Go programs for some time.

@nilium
nilium / args.go
Last active Mar 26, 2018
Boring multi-command dd-like argument parsing
View args.go
// args.go is a CLI arg parser for ipexec and other tools I've written but not released.
// It is here mainly as a backup since I don't feel particularly compelled to make a package out of it.
// TODO: Figure out which version is newest and update this.
package main
import (
"net/url"
"strconv"
@nilium
nilium / qwerty.txt
Created Feb 17, 2018
Advantage 2 Config
View qwerty.txt
[escape]>[caps]
[caps]>[escape]
[kp-caps]>[kp-escape]
[up]>[down]
[down]>[up]
[kp-right]>[kp-down]
[kp-left]>[kp-up]
[intl-\]>[=]
[kp-insert]>[kp-lalt]
[kp=]>[kp=mac]
You can’t perform that action at this time.