Skip to content

Instantly share code, notes, and snippets.

mrw34 /
Created Mar 17, 2018
Install "go read" on App Engine using Google Cloud Shell
# open
gcloud projects create $PROJECT_ID
gcloud app create --project=$PROJECT_ID
goapp get -d
cd ~/gopath/src/
sed s/go-read/$PROJECT_ID/ app.sample.yaml >app.yaml
cp ../settings.go.dist ../settings.go
goapp deploy
mrw34 /
Last active Sep 16, 2020
Enabling SSL for PostgreSQL in Docker
set -euo pipefail
openssl req -new -text -passout pass:abcd -subj /CN=localhost -out server.req -keyout privkey.pem
openssl rsa -in privkey.pem -passin pass:abcd -out server.key
openssl req -x509 -in server.req -text -key server.key -out server.crt
chmod 600 server.key
test $(uname -s) == Linux && chown 70 server.key
docker run -d --name postgres -e POSTGRES_HOST_AUTH_METHOD=trust -v "$(pwd)/server.crt:/var/lib/postgresql/server.crt:ro" -v "$(pwd)/server.key:/var/lib/postgresql/server.key:ro" postgres:12-alpine -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
mrw34 / package.json
Created Apr 6, 2016
Mixpanel export
View package.json
"dependencies": {
"moment": "^2.12.0",
"request": "^2.70.0",
"underscore": "^1.8.3"
mrw34 /
Last active Feb 29, 2016
A primitive mailx emulator using bash, curl and Mailgun
set -eu -o pipefail
cmd="curl -s --user 'api:$MAILGUN_API_KEY'$MAILGUN_DOMAIN/messages"
while getopts "r:c:b:s:a:E" opt; do
case $opt in
cmd+=" -F from='$OPTARG'"
mrw34 / package.json
Created Dec 14, 2015
West London Xmas Hack Night
View package.json
"dependencies": {
"underscore": "^1.8.3",
"vorpal": "^1.4.0",
"ws": "^0.8.1"
mrw34 / gist:b12531d1a8df25f6c170
Last active Jul 29, 2019
Trello JSON to CSV conversion using jq
View gist:b12531d1a8df25f6c170
jq -r '["List", "Card"], ((reduce .lists[] as $list ({}; .[$] = $ as $lists | .cards[] | select(.closed != true) | [$lists[.idList],.name]) | @csv' <nw3RUeLl.json
mrw34 / index.js
Last active Apr 11, 2016
Stable JavaScript Object hash function for Node.js
View index.js
function hash(object, algorithm, encoding) {
var h = require('crypto').createHash(algorithm || 'md5');
(function update(v, k) {
if (k !== undefined) {
if (v && v.constructor === Array) {
v.forEach(function(value) {
update(h, value);
mrw34 / blog.xml
Created May 26, 2014
Minimal Jekyll Atom feed template
View blog.xml
<feed xmlns="">
<updated>{{site.time | date_to_xmlschema}}</updated>
<link href="http://{{site.domain}}/blog.xml" rel="self"/>
{% for post in site.posts %}
View main.html
{{> hello}}
<template name="hello">
{{#with people}}
You can’t perform that action at this time.