Skip to content

Instantly share code, notes, and snippets.

View typingincolor's full-sized avatar

Andrew Braithwaite typingincolor

View GitHub Profile
Case
THERMALTAKE V200 2.0 TEMPERED GLASS RGB EDITION GAMING CASE
Processor (CPU)
AMD Ryzen 7 3700X Eight Core CPU (3.6GHz-4.4GHz/36MB CACHE/AM4)
Motherboard
ASUS® PRIME B450-PLUS (DDR4, USB 3.1, 6Gb/s) - RGB Ready!
Memory (RAM)
@typingincolor
typingincolor / checkmail.bash
Last active October 29, 2015 08:02
blink if you have mail
#!/bin/bash
function f_curl {
curl -s -X "SEARCH UNSEEN" -k -u $1:$2 --url $3
}
f_curl $username $password imaps://$host/INBOX | awk '{if (NF > 2) system("/usr/local/bin/blink1-tool -q --rgb=#FF0000 --blink 3");}'
f_curl $username $password imaps://$host/INBOX | awk -v host="$host" -F '{print host ":\t", NF - 2}'
@typingincolor
typingincolor / terminal.bash
Last active October 29, 2015 15:54
Terminal Prompt Magic
function __git_branch() {
b=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
if [ ! -z "$b" ]; then
echo "($b) "
else
echo ""
fi
}
function __git_dirty() {
package repository
import (
"encoding/json"
"fmt"
"github.com/influxdb/influxdb/client"
"log"
"time"
)

Keybase proof

I hereby claim:

  • I am typingincolor on github.
  • I am andrewb (https://keybase.io/andrewb) on keybase.
  • I have a public key whose fingerprint is CCF9 7689 5874 5772 B24B 5072 F112 3AB2 AD71 3740

To claim this, I am signing this object:

@typingincolor
typingincolor / difference
Last active December 18, 2015 22:49
When using swagger-ui, working.js spec displays correctly but not-working.js does not. The only difference between them is that working has a dummy api method (see difference). If you look at the /stores/{storeName}/products/{id} GET. The working version shows Pro, and BestUse models in the schema. For the non-working version they don't.
{
path: "/stores/dummy",
description: "Store operations",
operations: [{
parameters: [],
httpMethod: "GET",
notes: "Dummy method to get around Swagger problem",
errorResponses: [],
nickname: "dummy",
summary: "Dummy Method",
@typingincolor
typingincolor / gist:5848610
Last active December 18, 2015 21:38
Bit of a odd one. I've used swagger-node-express to generate this api spec, but I've discovered an interesting problem. If you look at the Store model, you can see a storeImage attribute in the json of type Media. If you remove this, the array of Media objects in the ProductDetails model doesn't render properly in swagger-ui: the Media object is…
{
apiVersion: "0.1",
swaggerVersion: "1.1",
basePath: "http://desolate-caverns-4564.herokuapp.com",
resourcePath: "/store",
apis: [{
path: "/store/{storeName}",
description: "Store operations",
operations: [{
parameters: [{