Skip to content

Instantly share code, notes, and snippets.

View rnorth's full-sized avatar

Richard North rnorth

View GitHub Profile
@rnorth
rnorth / gist:f7e2fad195662fd2cb26
Created September 19, 2014 06:38
Check bitbucket open repository count is expected
[[ $(http "https://bitbucket.org/api/2.0/repositories/{username}" | jq '.values | length') == 0 ]]
@rnorth
rnorth / gist:4a9651c2c36ba71a5ab2
Created September 22, 2014 02:36
Fish function: chmox
function chmox
chmod +x $argv
end
@rnorth
rnorth / Factorial.java
Last active August 29, 2015 14:10
Java 8 functional play
import java.math.BigInteger;
import java.util.stream.IntStream;
public class Factorial {
public static void main(String[] args) {
System.out.println(Factorial.factorial(1));
System.out.println(Factorial.factorial(5));
System.out.println(Factorial.factorial(120000));
}
@rnorth
rnorth / keybase.md
Last active August 29, 2015 14:19
keybase.md

Keybase proof

I hereby claim:

  • I am rnorth on github.
  • I am richnorth (https://keybase.io/richnorth) on keybase.
  • I have a public key whose fingerprint is 8AC1 FA76 2457 703F 759C 8CF1 E052 0DA8 3FDC BD43

To claim this, I am signing this object:

@rnorth
rnorth / gist:92f0cea7f0b850d6e334
Last active August 29, 2015 14:22
Chrome/Firefox in docker, launched as a JUnit rule, ready for use in Selenium/Webdriver tests. Built on top of https://github.com/rnorth/test-containers
Now merged into master, and released as v0.9.1.
@rnorth
rnorth / bmobile.mobileconfig
Created September 2, 2015 13:11
iOS 9 compatible APN settings mobileconfig file for Japan B-Mobile SIM Free Data
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ConsentText</key>
<dict>
<key>default</key>
<string>B-Mobile SIM フルーdata</string>
</dict>
<key>PayloadContent</key>
@rnorth
rnorth / samsung_remote.py
Created December 27, 2011 09:20 — forked from danielfaust/samsung_remote.py
Samsung TV Remote Control Python Script
import time
import socket
import base64
src = '192.168.1.2' # ip of remote
mac = '00-AB-11-11-11-11' # mac of remote
remote = 'python remote' # remote name
dst = '192.168.1.3' # ip of tv
app = 'python' # iphone..iapp.samsung
@rnorth
rnorth / gist:3780792
Created September 25, 2012 09:13
Tampermonkey script: Apple Dev ID team selection helper
// ==UserScript==
// @name Apple Dev ID team selection helper
// @namespace git://gist.github.com/3780792.git
// @version 0.1
// @description Makes the select team dropdown more helpful if you have Dev and Enterprise enrolments for the same firm
// @match https://developer.apple.com/*/selectTeam.action
// @copyright 2012, Richard North
// ==/UserScript==
var options = document.getElementsByTagName("option");
for (job in Hudson.instance.items) {
if (! job.logRotator ) {
job.logRotator = new hudson.tasks.LogRotator ( 30, 40, 30, 10) // days to keep, num to keep, artifact days to keep, num to keep
println "$job.name edited and changed to statement below"
}
}
@rnorth
rnorth / client_generation.md
Last active December 17, 2015 10:13
On generation of API clients from a spec

Goals

Generate client code from an existing API spec written in Swagger format

  • Build type-safe clients for HTTP APIs, so that compatibility is verified at compile time
  • Produce client code that is usable as-is and with an express goal of no manual modification, so that generation can be a routine step in a project's build process
  • Support multiple languages for clients on suitable platforms. Mainly support languages that have static typing
  • Provide an easy-to-understand fluent interface
  • Generate both client (accessor) and model (POJO/struct) from the spec