Skip to content

Instantly share code, notes, and snippets.

View trptcolin's full-sized avatar

Colin Jones trptcolin

View GitHub Profile
// Package secret provides encrypt/decrypt functionality with a string-oriented API.
//
// The design choice to use strings is purely for ease of API use, almost certainly not a good idea.
// To be clear, this thing is not intended for production use, just for poking around the Go ecosystem.
// In particular, there are performance implications with all the stringification, and I wouldn't trust the error handling.
// There may be additional / worse issues too!
//
// Uses `golang.org/x/crypto/nacl/secretbox` for the actual cryptography, and `encoding/base64` to round-trip into strings.
package secret

Recap

Details / How

[colin:/tmp] $ node --version
v11.14.0
[colin:/tmp] $ node /tmp/sample.js
internal/process/stdio.js:164
stream = new tty.WriteStream(fd);
^
TypeError: tty.WriteStream is not a constructor
at createWritableStdioStream (internal/process/stdio.js:164:16)
at process.getStdout [as stdout] (internal/process/stdio.js:33:14)

TL;DR: what was the bug? (spoilers!): https://gist.github.com/trptcolin/6039cd454acfe6e820d13cbdce5e4064

defmodule MyApp.Router do
use MyApp, :router
use Plug.ErrorHandler
use Sentry.Plug
alias MyApp.ScrubError
defp handle_errors(conn, %{kind: _kind, reason: _reason, stack: _stack} = error) do
updated_error = ScrubError.call(error)
super(conn, updated_error)
@trptcolin
trptcolin / readme.txt
Created September 22, 2018 20:49
Zombie Invasion (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
@trptcolin
trptcolin / readme.txt
Created September 22, 2018 20:49
Zombie Invasion (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
@trptcolin
trptcolin / readme.txt
Created September 22, 2018 20:46
Zombie Invasion (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
@trptcolin
trptcolin / readme.txt
Created September 22, 2018 20:38
Zombie Invasion (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html

For all exercises, let’s make sure we’re collaborating, not just submitting as quick as possible. We are a community of professionals - let’s learn from each other!

While we need working software, we also want well-crafted software. So once we’ve got a working solution, let’s see how we can improve it for flexibility and maintainability, rather than jumping right to the next one.

  • Driver: Lean on your team! Talk through your reasoning! Pass the keyboard in 5 minutes or less!
  • Navigators: Ask questions! Suggest improvements empathetically!
  • Narrator: Nudge folks as needed! Stick with the Easy difficulty setting!

Example Exercises, with extra credit ideas/prompts