Skip to content

Instantly share code, notes, and snippets.

@awendland
awendland / .merlin
Created March 26, 2020 00:25
A .merlin file for working on webassembly/spec/interpreter
S ./**
B _build/**
@awendland
awendland / gen_docker_certs.sh
Last active June 24, 2018 05:14
Generate a CA and issue cert pairs for usage by a docker server and client
#! /bin/bash
###############################################################################
# Generate the server and client certificates required to secure and verify
# both the Docker daemon and Docker client when communicating over an HTTP
# socket using TLS.
#
# NOTE: These steps can all be completed manually as well. Simply follow the
# requirements specified by the DIY comments to generate the appropriate certs.
# This website provides good information about the process:
# https://jamielinux.com/docs/openssl-certificate-authority/sign-server-and-client-certificates.html
@awendland
awendland / setup_ecr_credential.sh
Created June 12, 2018 19:09
Convenience script for installing a pre-compiled version of https://github.com/awslabs/amazon-ecr-credential-helper on macOS and 64-bit linux
#!/bin/bash
set -e
##################################################################################
# Configure the ECR credential helper to make interacting with the ECR
# repo eaiser from the Docker client.
#
# Usage: `./setup_ecr_credential.sh`
#
# $OS (defaults to autodetection using OSTYPE) - macos OR linux, which
@awendland
awendland / rgb_server.py
Last active February 4, 2017 23:42
Raspoberry Pi + LED strip + UDP Server
from __future__ import print_function
import datetime
# Setup UDP server
import socket
UDPSock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
listen_addr = ("", 21567)
UDPSock.bind(listen_addr)
print("Listening on port {}\n".format(listen_addr[1]))
print("Commands: `COMMAND PARAMS`")
  1. Each command in container_command runs in its own shell. Therefore, you can't rely on setting up environment variables before and using them later.
  • Solution to this is to create a file which exports the environment variables that you want. Create this with the files config property and place it somewhere accessible.
  • Then place the commands you would want to be run by command in a .sh file. In that .sh file, source the environment variables file that was created earlier. Set the command to execute the .sh file. Make sure that the .sh file has executable permissions set locally because git syncs those.
@awendland
awendland / best_mango_lassi_in_soma.md
Last active August 9, 2016 20:03
Review of Mango Lassis in the SOMA area

Best Mango Lassi in SOMA

I'm a huge fan of mango lassi's, and since I'm spending 5 days a week working at 2nd street and Howard I decided to try out and track down the best mango lassi in the area. Here're the ongoing results of my search.

Schedule

  • Tava Kitchen
  • Mehjir
  • North India
@awendland
awendland / demo.js
Created June 18, 2016 21:30
Chai unordered array equality
const expect = require('chai').expect;
const arr = ['email', 'password'];
expect(arr).to.have.members(['email', 'password']); // true
expect(arr).to.have.members(['email']); // false
expect(arr).to.have.members(['email', 'password','extra']); //false
@awendland
awendland / til.schema.json
Created April 2, 2016 19:49
Json schema for today I learned entry
{
"id": "http://some.site.somewhere/entry-schema#",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "schema for today I learned entry",
"type": "object",
"required": [ "title" ],
"properties": {
"title": {
"type": "string"
},

Keybase proof

I hereby claim:

  • I am awendland on github.
  • I am awendland (https://keybase.io/awendland) on keybase.
  • I have a public key ASCXIHQRVrtIg32gDOXbZwDRIvgqnAoH-IuvcJNt911vzQo

To claim this, I am signing this object:

@awendland
awendland / Optional.ts
Last active February 3, 2016 21:16
Basic implementation of handling null/falsy values functionally
/**
* Optional wrapper type for functional handling of nulls/falsy values
*
* @TODO Support chaining of .or()
*/
export class Optional<T> {
constructor(
private _val: T,
private _justNull = false) {}