Skip to content

Instantly share code, notes, and snippets.


Richard Nienaber rjnienaber

View GitHub Profile
rjnienaber / exams.go
Last active Jul 25, 2021
repository pattern in Go
View exams.go
package controllers
import (
View resume.json
"basics": {
"name": "Richard Nienaber",
"label": "Senior Software Engineer at vTail",
"email": "",
"phone": "+44 785 7817 078",
"summary": "A versatile developer with 16+ years of experience across several industries, including finance and healthcare. An experienced remote worker who has been able to effectively engage with developers spread out across multiple timezones.",
"location": {
"countryCode": "GB",
"address": "Christchurch, UK",
#!/usr/bin/env bash
docker build -t snyk_test - << END
FROM alpine:3.9
RUN apk update
RUN apk upgrade
RUN apk add jq
RUN cat /etc/os-release | grep VERSION && jq --version
rjnienaber /
Last active Jan 8, 2020
hotsapi setup
#!/usr/bin/env bash
# bring up mysql service
docker-compose up -d mysql
while ! nc -z localhost 3306; do
sleep 0.1 # wait for 1/10 of the second before check again
# install composer dependencies locally because we are using local files instead of content dir from the container
rjnienaber /
Last active Dec 9, 2019
Example wait for script
#!/usr/bin/env bash
STOP_TIME=`date -d "now + 30 seconds" +%s`
# loop until we get a connection
until nc -z localhost 3306
# if current time is > STOP_TIME, timeout has been exceeded so exit
if [[ `date +%s` -gt $STOP_TIME ]]; then
echo Timed out waiting for connection
exit 1
rjnienaber /
Last active Jul 25, 2019
pick random user from support slack channel
module.exports = (robot) ->
robot.respond /get help/i, (res) ->
# get channel list from slack, might require some extra filtering if there's lot of them
.header('Accept', 'application/json')
.get() (err, response, body) ->
channels = JSON.parse(body).channels
supportChannelMembers = channels.filter((c) => == 'support')[0].members
# filter users by channel and status
rjnienaber /
Created Sep 6, 2018
Compile ImageMagick with WEBP and HEIC support on Ubuntu 16.04
# $ lsb_release -a
# No LSB modules are available.
# Distributor ID: Ubuntu
# Description: Ubuntu 16.04.5 LTS
# Release: 16.04
# Codename: xenial
# $ uname -a
# Linux xps 4.4.0-134-generic #160-Ubuntu SMP Wed Aug 15 14:58:00 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
rjnienaber / stdout
Created Nov 20, 2017
artillery with regex capture
View stdout
$ DEBUG=http ./node_modules/.bin/artillery run test.yml
Started phase 0, duration: 1s @ 20:31:32(+0000) 2017-11-20
⠦ http request: {
"url": "",
"method": "GET",
"headers": {
"user-agent": "Artillery ("
} +0ms
rjnienaber /
Created Nov 14, 2017
Simple example of flattening an array in python3
def _flatten(values):
"""Recursively flattens a list using yield from"""
for v in values:
if (isinstance(v, list)):
yield from _flatten(v) #
yield v
def flattened_list(values):
"""Recursively flattens a list. If the passed in argument is not a list, an
rjnienaber / Dockerfile
Created Oct 2, 2017
PHP 5.5 on Alpine Linux
View Dockerfile
# base for this file taken from here:
FROM alpine:3.6
RUN apk add --no-cache --virtual .persistent-deps \
ca-certificates \
curl \
tar \
xz \
apache2 \