Skip to content

Instantly share code, notes, and snippets.

View JosephSalisbury's full-sized avatar
🏹

Joe Salisbury JosephSalisbury

🏹
View GitHub Profile
{
network.description = "Development infrastructure";
vm =
{ config, pkgs, ... }:
let
gsctl = pkgs.buildGoPackage rec {
name = "gsctl-${version}";
version = "b9e631e8d7f273271055beab49b574f5b4fcc4bd";
#!/usr/bin/ruby
# Script creating a disk img from a compiled ignition config read from stdin
# Based on https://github.com/coreos/vagrant-ignition/blob/master/lib/vagrant-ignition/action/IgnitionDiskGenerator.rb
# See https://github.com/coreos/bugs/issues/1573
require 'zlib'
# Note: gpt and gpt2 are the primary and secondary headers respectively
class IgnitionDiskGenerator

Keybase proof

I hereby claim:

  • I am JosephSalisbury on github.
  • I am salisbury_joe (https://keybase.io/salisbury_joe) on keybase.
  • I have a public key whose fingerprint is 0659 1048 A319 B94E 3341 2609 1C6A 4134 9CB5 5511

To claim this, I am signing this object:

{
  "join-policy": "none|simple|gs-unit-chain",
  "units": [
    {
      "name": "ambassador",
      "type": "ambassador",
      "definition": {
        "dependency": "app",
 "port": 80
$ cat example.json
{
  "units": {
    "ambassador.service": {
      "includes": ["ambassador.json", "restart_policy.json"],
      "overrides": {
        "Unit": {
          "Wants": ["user-app.service]
        },
$ cat format.json
{
  "units": {
    "pre-sidekick": {
      "type": "ambassador",
      "port": 80
    },
    "user-app": {
 "name": "name",
@JosephSalisbury
JosephSalisbury / workflow.md
Last active August 29, 2015 14:27
formalising my github workflow, so it can be automated!

current workflow

  1. find issue to work on
  2. create branch, branch name off issue
  3. hack, hack, hack
  4. push branch
  5. open pull request
  6. check pull request (status checks, reviews)
  7. merge pull request
  8. delete remote feature branch
  9. checkout master
@JosephSalisbury
JosephSalisbury / statement.py
Created January 18, 2015 17:03
Plot Natwest statements
#!/usr/bin/python
# -*- coding: utf-8 -*-
from dateutil import parser
from matplotlib import pyplot
from numpy import array
def convert_line_to_datetime(line):
""" Given a line, return the date of the line as a datetime object. """
@JosephSalisbury
JosephSalisbury / Colour Chooser
Created January 15, 2015 21:58
Colour Chooser
from hashlib import md5
from sys import argv
def main():
text = raw_input()
hex_code = md5(text).hexdigest()[:6]
print '#%s' % hex_code
@JosephSalisbury
JosephSalisbury / fill
Created November 19, 2014 15:39
Fill up a container, to some numerical limit, from another container dependent on some predicate between the item and the dependent container.
""" Fill up a container, to some numerical limit, from another container
dependent on some predicate between the item and the dependent
container. """
from itertools import takewhile
import unittest
def fill(source, destination, limit, predicate):