Skip to content

Instantly share code, notes, and snippets.

View icio's full-sized avatar
💬
icio is typing...

Paul Scott icio

💬
icio is typing...
View GitHub Profile
@icio
icio / _readme.md
Last active October 13, 2015 23:27
Git review

About

A utility for interfacing with reviewable git branches, as per GitHub issues. This is a wrapper around ghi.

Usage

git review [-h | -l [LABEL] | [-w] ISSUE | -s | -u]
   git review            List reviewable issues
   git review -h         Print usage instructions

git review -l Print the review label filtered by

@icio
icio / _readme.md
Created November 29, 2013 14:11
Dominos Slack notifier

Dominos → Slack Notifier

Paste this snippet into your web browser's console when viewing the Pizza Tracker page offered after submitting a Dominos order. When the state changes it'll post the order state to your specified Slack Incoming Webhook. Use the URL at the top of your existing integration to paste into the prompt you receive when running the snippet. It should be in the form of: "https://TEAM.slack.com/services/hooks/incoming-webhook?token=TOKEN".

You'll need to leave your browser window open until it's done, of course. Tested in Chrome in the UK. Not tested with collections.

@icio
icio / tiles.py
Created January 5, 2014 07:07
Python command-line tile world for unix terminals
#!/usr/bin/env python
def world():
world = [
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 1, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 1, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 1, 0, 0, 0, 1],
@icio
icio / jira-issue-map-copy.js
Created January 10, 2014 14:23
Useful for when you have to move from one JIRA workflow to another but don't want to repeat the mapping for every fucking issue type.
/**
* Duplicate the mapping of Current Status to New Status from the first
* issue type to the subsequent issue types.
*/
var tbody = document.getElementById('workflow-mapping-table').querySelector('tbody');
var cell = tbody.appendChild(document.createElement('tr')).appendChild(document.createElement('td'));
cell.setAttribute("colspan", 3);
cell.style.textAlign = "right";
@icio
icio / azure.txt
Last active January 3, 2016 12:59
Azure IP ranges from http://msdn.microsoft.com/en-us/library/windowsazure/dn175718.aspx converted into a format for Cloudflare's threat control.
65.52.128.0/20
65.52.144.0/20
213.199.128.0/21
213.199.136.0/22
168.63.4.0/22
168.63.8.0/22
168.63.20.0/22
168.63.24.0/21
137.116.204.0/22
168.63.12.0/22
@icio
icio / inputrc
Created January 22, 2014 13:47
Ubuntu input rc
# /etc/inputrc - global inputrc for libreadline
# See readline(3readline) and `info rluserman' for more information.
# Be 8 bit clean.
set input-meta on
set output-meta on
set completion-ignore-case on
set expand-tilde off
set mark-directories on
@icio
icio / _redland-raptor-rasqal-osx.md
Last active August 29, 2015 14:03
Building Redland's Raptor RDF Syntax Library and Rasqal RDF Query Library on OSX
  1. Ensure that you have the relevant build tools at your disposal. build-essential ought to cover it.
  2. Download and run install.sh.
  3. Once the script has complete you'll need to sudo make install the packages that you're interested in (or run them locally) -- that's your call. If you're only after roqet then cd rasqal* && sudo make install
from itertools import groupby, count
def debug_iter(iter):
for x in iter:
print "=> %d" % x
yield x
def groupn(n, it):
@icio
icio / index.html
Created July 18, 2014 10:59
Fit polygon in box
<!--
https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9
-->
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Polytext</title>
<style type="text/css">
.polytext {
@icio
icio / recurly-upgrade-2.1.2-2.3.1.patch
Created February 2, 2015 16:52
Recurly 2.1.2 → 2.3.1 Upgrade (./lib directory diff)
diff -r html/sites/all/libraries/recurly_v2/recurly/account.php vendor/recurly/recurly-client/lib/recurly/account.php
9c9,10
< function __construct($accountCode = null) {
---
> function __construct($accountCode = null, $client = null) {
> parent::__construct(null, $client);
11a13,15
> $this->address = new Recurly_Address();
> $this->balance_in_cents_invoiced = new Recurly_CurrencyList('balance_in_cents_invoiced');
> $this->balance_in_cents_uninvoiced = new Recurly_CurrencyList('balance_in_cents_uninvoiced');