Skip to content

Instantly share code, notes, and snippets.

Avatar
🐕
柴犬

Matt Lewis mplewis

🐕
柴犬
View GitHub Profile
View amanda_homework.md

TODO for each repo

  • Rename repos to something short and clean: all lowercase, underscores, keep it concise
    • Teachers app -> teacher_organizer
    • CLI APP Wic Clinic Finder -> wic_clinic_finder
  • Write description for repo in About section
  • Write README
  • Add LICENSE file
  • Make sure license appears in About section properly
  • Clean repo of unused/useless/incorrect files
  • Lint all files with RuboCop
@mplewis
mplewis / aoc-2019-day-1.ts
Created Dec 6, 2019
Advent of Code stuff
View aoc-2019-day-1.ts
const input = `
106404
140515
142745
120767
79665
54235
127391
72207
70799
View fargate_aws_cli.md

How to Run a Fargate Task from AWS CLI

AWS_PROFILE=mplewis \
AWS_DEFAULT_REGION=us-west-1 \
aws ecs run-task \
  --launch-type FARGATE \
  --task-definition http-hello-world \
  --network-configuration '<CONFIG>'
  --overrides '<OVERRIDES>'
@mplewis
mplewis / iam_sam_policy.json
Created Apr 5, 2019
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": [
"cloudformation:*",
"iam:CreateRole",
"iam:AttachRolePolicy"
@mplewis
mplewis / ceto.rb
Created Mar 22, 2019
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
SPECIALS = %w(
$\(
\)
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 rule.md

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

View keybase.md

Keybase proof

I hereby claim:

  • I am mplewis on github.
  • I am mplewis (https://keybase.io/mplewis) on keybase.
  • I have a public key ASB-0oi8GsJR5AnFzVqHDzlbud5P7W9JikrEx1deugi93wo

To claim this, I am signing this object:

View genesis_public_key
046f9979d118412339318d89c60da9261acd79b0a956b84c4331916ee11912c4a5569f5406cb3f34e3c1244a3e7d236a6117b69f1c9422364d53fbf3138b865f03