Skip to content

Instantly share code, notes, and snippets.


Matt Lewis mplewis

View GitHub Profile
mplewis / chat.go
Created September 23, 2022 21:14
Demo "chat" app which shows how to use Go and carraige returns to show live messages alongside an editable chat input line
View chat.go
package main
import (
mplewis /
Created September 18, 2022 21:16
Put this in your path as `shenv` to source .env file variables and run specific commands: `shenv development.env my-command`
set -euo pipefail
set -a; source "$1"; set +a
mplewis / aoc-2019-day-1.ts
Created December 6, 2019 21:09
Advent of Code stuff
View aoc-2019-day-1.ts
const input = `

How to Run a Fargate Task from AWS CLI

AWS_PROFILE=mplewis \
aws ecs run-task \
  --launch-type FARGATE \
  --task-definition http-hello-world \
  --network-configuration '<CONFIG>'
  --overrides '<OVERRIDES>'
mplewis / iam_sam_policy.json
Created April 5, 2019 16:30
Perms needed to successfully deploy a Lambda via AWS SAM
View iam_sam_policy.json
"Version": "2012-10-17",
"Statement": [
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
mplewis / ceto.rb
Created March 22, 2019 03:26
inspect a docker image's commands without having its dockerfile
View ceto.rb
#!/usr/bin/env ruby
# ceto
# from cetology: the scientific study of whales
# inspect a docker image's commands without having its dockerfile
# bash scripting stuff that probably needs to be broken up for visibility
View rei-passbook-fe.js
* @license
REI-Gearmail 0.1.0 2013-06-03 14:10 */
'use strict';
if ("undefined" == typeof console) {
window.console = {
log : function() {
error : function() {
View Type systems

A type system is good when it not only guardrails you from doing the wrong thing, but reminds you to do the right thing. A type system is excellent when it guides you toward doing the right thing without you having to tell it what you wanted.

Here are some examples of type systems I like and love:

Java: It's very hard to compile any Java at all. Because it's so strict about the types. If someone gives you a PayPal API JAR, you plug it in and say "oh, this #pay method takes a Recipient, an Amount, and a Details object. I better fill those in." If you don't provide exactly those three, you don't get to pay anyone.

C#: Instead of having to type out Map<String, Integer> recipients = new HashMap<>() like in Java, you can just let recipients, much like auto in C++. Inferring your type at creation is great. Less typing, I can already tell what the thing is.

JS Flow: JavaScript is the loosest (baylor inserts joke here) language known to man, besides maybe Lisp. See the wat talk. [1] Facebook engineers disco


Keybase proof

I hereby claim:

  • I am mplewis on github.
  • I am mplewis ( on keybase.
  • I have a public key ASB-0oi8GsJR5AnFzVqHDzlbud5P7W9JikrEx1deugi93wo

To claim this, I am signing this object:

View genesis_public_key