Skip to content

Instantly share code, notes, and snippets.

@wking
wking / external-ref.json
Last active August 29, 2015 14:09
external $ref in a Swagger spec's model properties
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Example $ref"
},
"host": "example.com",
"basePath": "/api",
"schemes": [ "http" ],
"paths": {
@wking
wking / gist:00cbcde402a8f0fc1483
Last active August 29, 2015 14:15
Current azurestandard/website dependencies

These are working for me, but I haven't refreshed them in a while, so they might not match what you'd get with a fresh install:

$ npm list
website@0.0.0 /home/wking/Private/azure/website
├─┬ grunt@0.4.5
│ ├── async@0.1.22
│ ├── coffee-script@1.3.3
│ ├── colors@0.6.2
│ ├── dateformat@1.0.2-1.2.3

│ ├── eventemitter2@0.4.14

@wking
wking / category-upload.py
Last active September 18, 2015 22:45
Upload product ↔ category associations
#!/usr/bin/env python3
#
# https://gist.github.com/wking/cf87063bd5f76be73db0
import csv
import json
import logging
import sys
import time
import urllib.request
@wking
wking / runtime.md
Last active September 19, 2015 08:25 — forked from julz/runtime.md
Example Runtime Spec

Operations

A conformant runtime should provide an executable (called funC in the following examples). The template for supported commands is:

$ funC [global-options] <COMMAND> [command-specific-options] <command-specific-arguments>

Global options

@wking
wking / gist:7915716
Last active December 31, 2015 01:39
Docker on Debian Wheezy
Enabled “wheezy main” and “wheezy-updates main” in
/etc/apt/sources.list, commented out the CD.
From http://backports.debian.org/Instructions/
# echo 'deb http://ftp.debian.org/debian/ wheezy-backports main' > /etc/apt/sources.list.d/backports.list
# apt-get update
# apt-get install lxc iptables bridge-utils libdevmapper-dev golang git mercurial gcc libsqlite3-dev
@wking
wking / ChangeLog
Last active February 4, 2016 23:32
opencontainers/specs v0.3.0
Breaking changes:
* config: Single, unified config file, #284
* config: cwd is a required default and must be absolute, #286,
#307, #308, #312
* config: Qualify the name of the version field, #309
* config-linux: Convert classID from hex to uint32, #296
* config-linux: Separate mknod from cgroups, #298
Additions:
package main
import (
"fmt"
"regexp"
"strings"
)
var multiSlashRegexp = regexp.MustCompile("//*")
var multiBackslashRegexp = regexp.MustCompile("\\\\*")
$ git clone git://github.com/ldthomas/apg-6.3.git
$ cd apg-6.3
$ ./configure
$ make
$ cat <<EOF >>ref.abnf
> ref = component *("/" component)
> component = alphanum *(separator alphanum)
> alphanum = 1*(ALPHA / DIGIT)
> separator = "--" / "-" / "." / "_" / ":" / "@" / "+"
> ALPHA = %x41-5A / %x61-7A
Undefined
ref := component ["/" component]*
component := alphanum [separator alphanum]*
alphanum := /[A-Za-z0-9]+/
separator := /[-._:@+]/ | "--"
ABNF
ref = component *("/" component)
Values SHOULD conform to the following grammar (specified in [XML 1.0's EBNF][ebnf]):
```
ref ::= component ("/" component)*
component ::= alphanum (separator alphanum)*
alphanum ::= [a-zA-Z0-9]+
separator ::= [-._:@+] | "--"
```
[ebnf]: https://www.w3.org/TR/REC-xml/#sec-notation