Skip to content

Instantly share code, notes, and snippets.

View argon's full-sized avatar

Andrew Naylor argon

View GitHub Profile
@argon
argon / ttc2ttf.pe
Created July 16, 2020 17:40 — forked from fatum12/ttc2ttf.pe
Unpack .ttc and .dfont to .ttf using FontForge
#!/usr/local/bin/fontforge
# Usage: fontforge -script ttc2ttf.pe /path/to/font.ttc
fonts = FontsInFile($1)
n = SizeOf(fonts)
i = 0
while (i < n)
Open($1 + "(" + fonts[i] + ")", 1)
index = ToString(i + 1)
@argon
argon / apn-bench.js
Created March 30, 2015 22:31
node-apn benchmark
var apn = require('apn');
var token = "<token here>";
var service = new apn.connection({
maxConnections: 1
});
service.on("completed", function() { console.log("Completed!")});
service.on("connected", function() { console.log("Connected"); });
@argon
argon / gist:127444b0f89fa796730a
Created October 15, 2014 15:45
Bluemix/Node-RED demo from IBM Watson Tech Pioneer and Developer Day. Monitors tweets and routes through Watson Q&A API, with added translation
[
{
"id": "489498c.fb76b68",
"type": "watson-question-answer",
"name": "",
"output": "top",
"corpus": "healthcare",
"x": 469,
"y": 240,
"z": "17a16c06.e85e94",
Verifying myself: My Bitcoin username is +argon. https://onename.io/argon

Keybase proof

I hereby claim:

  • I am argon on github.
  • I am argon (https://keybase.io/argon) on keybase.
  • I have a public key whose fingerprint is 4F7A 7D7A 91EE 27D0 CB04 A973 B1EC 1B8F 7773 9CE3

To claim this, I am signing this object:

@argon
argon / arduino_spi_slave.pde
Created January 20, 2013 11:42 — forked from chrismeyersfsu/arduino_spi_slave.pde
Arduino SPI slave example
// Written by Nick Gammon
// Updated by Andrew Naylor (March 2013)
// February 2011
/**
* Send arbitrary number of bits at whatever clock rate (tested at 500 KHZ and 500 HZ).
* This script will capture the SPI bytes, when a '\n' is recieved it will then output
* the captured byte stream via the serial.
*/
@argon
argon / connection.js
Created July 5, 2012 10:04
connection.js with clientError handling.
var Errors = require('./errors');
var fs = require('fs');
var q = require('q');
var tls = require('tls');
var util = require('./util');
try {
var debug = require('debug')('apn');
}
catch (e) {
@argon
argon / gl-resque.service
Created July 3, 2012 10:15
GitLab systemd files
[Unit]
Description=Gitlab Resque
[Service]
Type=forking
SyslogIdentifier=gl-resque
User=gitlab
PIDFile=/home/gitlab/gitlab/tmp/pids/resque_worker.pid
WorkingDirectory=/home/gitlab/gitlab
@argon
argon / id_rsa.pub
Created June 17, 2012 16:11
My Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAouQfBprYcBeufr4i+/2jUwQPBYM7yWVZ76CRQdrmGGhZWE7xtC/PBOrDV7+2R7hyNdHCODDJMRyxWdVkz4d7vgjEH4/6rgj4vcl/UAKJu4QaUJMrVFgTbcfDYgTapi3IbDQayRs4e2dYPt9GiHI1IiLn3ToCy25K28rDiDP2Qjuk8o1VyLxVWEPZrCLN2z5RJ8FoapxdYQpgLBOmpBx6y/rxJScigO8vS+Cs0k9UPa2JAUnImV1pO/0zBgOvYWS+wasoidEL3ysJr4joZYomdb/GYWr6JUXQeUif1z2ulbKTLqRuTvcp/e6BA2ID5pkhUucSyFmEQX4WoCbya5cdLQ== [email protected]
@argon
argon / git-detached
Created July 14, 2011 10:28
Shell script to create a detached working directory
#!/bin/bash
if [ $# -lt 2 ]
then
echo "usage error: $0 <git dir> <work tree>"
exit 1;
fi
CWD=`pwd`
if [ ! -d $1 ]