Skip to content

Instantly share code, notes, and snippets.

Duncan Sample dsample

Block or report user

Report or block dsample

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
dsample / Dockerfile
Last active May 8, 2019
Sonar Scanner as a Docker image
View Dockerfile
FROM openjdk:latest
RUN curl -sL | bash - \
&& yum install -y curl unzip \
&& mkdir /sonar \
&& curl -sSL -o / \
&& unzip -qd /sonar/ / \
&& mv /sonar/*/* /sonar/ \
&& rm / \
&& yum erase -y unzip \
dsample / .editorconfig
Last active May 28, 2019
Some files which I usually include within a repo's 'first commit'
View .editorconfig
# EditorConfig is awesome:
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
charset = utf-8
indent_style = space
indent_size = 2
dsample /
Last active Apr 4, 2019
Typey Type custom lessons

Typey Type custom lessons

Typey Type is a practise site for stenotype typists. If you don't know what stenotype, or Plover is, it's the method used for closed/open captioning (subtitles) and realtime courtroom transcriptions. Where you may be used to a 'qwerty' layout keyboard with anywhere from 60-110 keys, a stenotype machine has 25-36 keys, and they're played in chords, like a musical keyboard, with each depression of a chord of keys signifying a word (or partial word).

To put some of this together, I've used Plover dictionary lookup tool.

From what I've seen, most people take months or years to learn stenotype. I'm (initially) trying to pick it up in a month, with only a short amount of practise at the beginning of each day. Because of this, I'm going to be trying to think about how to speed up the learning process, and a lot of the beginning lessons here are going to be

dsample /
Last active Oct 16, 2018
How DNS works

Some example flows for a Medium post about how DNS works.

dsample /
Last active Apr 28, 2018
Standardised healthcheck API schema

Standardised healthcheck API

This is a draft proposal for OpenAPI, or an extension thereof, which details an approach for microservices to communicate health in a detailed manour.

The depth parameter is intended so that the complete architecture underpinning a service can be discovered.

The bearer header allows services to control access to detailed health information. This also means that integration across boundaries can be controlled using different authoritive identity providers.

dsample /
Last active Mar 19, 2018
ASCII art diagrams

ASCI art characters for creating diagrams


Single line

  • ASCII code 191 = ┐ ( Box drawing character single line upper right corner )
  • ASCII code 192 = └ ( Box drawing character single line lower left corner )
  • ASCII code 193 = ┴ ( Box drawing character single line horizontal and up )
  • ASCII code 194 = ┬ ( Box drawing character single line horizontal down )
dsample / yaml2json.js
Created Mar 8, 2018
Convert a directory of YAML to JSON
View yaml2json.js
const yaml = require('yamljs')
const fs = require('fs')
const directory = process.argv[2] || '.'
.filter(f => f.endsWith('.yaml'))
.map(f => f.substring(0,f.indexOf('.yaml')))
.forEach((name) => {
const fromYaml = yaml.load(name + '.yaml')
import os
import pygame
import time
import random
class pyscope :
screen = None;
def __init__(self):
"Ininitializes a new pygame screen using the framebuffer"
dsample /
Created Nov 16, 2016
A JavaScript snippet to help 'leave' many repositories where you have been added as a contributor

I got added as a contributor in ~400 repositories in my organisation by accident. This JavaScript helped me undo that problem. Just head over to, change the logic for which repositories you want to leave and then run the leaveOne as many times as necessary.

dsample /
Created Aug 11, 2016
Node-RED Flows

These Node-RED snippets accompany a blog post I wrote about using Docker and Node-RED on a Raspberry Pi to integrate IoT devices.

You can’t perform that action at this time.