Skip to content

Instantly share code, notes, and snippets.

View StevenACoffman's full-sized avatar

Steve Coffman StevenACoffman

View GitHub Profile
import java.util.AbstractMap.SimpleEntry;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
class Balance {
String hello = "hello";
List<String> beginnings = Arrays.asList("[", "(", "{");
Map<String, String> endingsToBeginnings = Collections.unmodifiableMap(Stream.of(
new SimpleEntry<>("]", "["),

Notes from experienced React developers at Khan Academy and Symphono

Configuring the tooling for React is the biggest hurdle.

create react app is the easiest entry point to getting the tooling correct for a react app. You can eject later if you want advanced configuration.

npm install -g create-react-app
Browser Type Clean Clean Suspect Suspect
PerimeterX Mode Monitor Blocking Monitor Blocking
Excelsior Restarts 1 1? 2 3(+?)
PerimeterX Restarts 0 0? 1 0
@StevenACoffman
StevenACoffman / CodeMash Best Presentations.md
Last active January 18, 2017 18:31
CodeMash 2017 Best Presentations
@StevenACoffman
StevenACoffman / s3walk.py
Created February 9, 2017 23:36
Recursively walk S3 file contents from root url
#!/usr/bin/env python
import boto3
from datetime import datetime
import json
import sys
import re
def json_serial(obj):
"""JSON serializer for objects not serializable by default json code"""
#!/bin/bash
# expects the lambda function .py file to be in the same directory as this script.
# based off of Amazon's official documentation:
# http://docs.aws.amazon.com/lambda/latest/dg/with-s3-example-deployment-pkg.html#with-s3-example-deployment-pkg-python
# get the lambda function
lambda_func_file=$1
lambda_func="${lambda_func_file%.*}"
# exit if no file specified
[[ -z "$1" ]] && { echo "Lambda function is empty" ; exit 1; }
# generate a deployment timestamp
@StevenACoffman
StevenACoffman / lambda.py
Created February 12, 2017 17:29 — forked from babo/lambda.py
Simple AWS lambda job to create an SQS event for each S3 events.
#!/usr/bin/env python
import argparse
import logging
try:
from urllib import splittype
except ImportError:
from urllib.parse import splittype
import boto3
@StevenACoffman
StevenACoffman / s3_price_tag.py
Last active February 14, 2017 15:01
Recursively walk S3 and tag items based upon a mapping
#!/usr/bin/env python
import argparse
import boto3
import fnmatch
import json
import logging
import re
from collections import OrderedDict
from datetime import datetime
@StevenACoffman
StevenACoffman / s3_price_tag_lambda.py
Last active February 14, 2017 15:07
Tag S3 Objects by mapping file
#!/usr/bin/env python
import argparse
import boto3
import fnmatch
import json
import logging
import re
from collections import OrderedDict
from datetime import datetime