Skip to content

Instantly share code, notes, and snippets.

Paul Scott icio

Block or report user

Report or block icio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@icio
icio / input.twig
Last active Aug 29, 2015
Twig JavaScript Escaping
View input.twig
{% set text = 'back & for"th' %}
<script>
console.log({
"str0": "{{ text }}",
"str1": "{{ 'back & for"th' }}",
"num1": {{ 123 }},
"str2": "{{ 'back & for"th' | e('html') }}",
"num2": {{ 123 }},
@icio
icio / recurly-upgrade-2.1.2-2.3.1.patch
Created Feb 2, 2015
Recurly 2.1.2 → 2.3.1 Upgrade (./lib directory diff)
View recurly-upgrade-2.1.2-2.3.1.patch
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');
@icio
icio / index.html
Created Jul 18, 2014
Fit polygon in box
View index.html
<!--
https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9
-->
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Polytext</title>
<style type="text/css">
.polytext {
View groupn.py
from itertools import groupby, count
def debug_iter(iter):
for x in iter:
print "=> %d" % x
yield x
def groupn(n, it):
@icio
icio / _redland-raptor-rasqal-osx.md
Last active Aug 29, 2015
Building Redland's Raptor RDF Syntax Library and Rasqal RDF Query Library on OSX
View _redland-raptor-rasqal-osx.md

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
@icio
icio / inputrc
Created Jan 22, 2014
Ubuntu input rc
View inputrc
# /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 / azure.txt
Last active Jan 3, 2016
Azure IP ranges from http://msdn.microsoft.com/en-us/library/windowsazure/dn175718.aspx converted into a format for Cloudflare's threat control.
View azure.txt
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 / jira-issue-map-copy.js
Created Jan 10, 2014
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.
View jira-issue-map-copy.js
/**
* 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 / tiles.py
Created Jan 5, 2014
Python command-line tile world for unix terminals
View tiles.py
#!/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 / _readme.md
Created Nov 29, 2013
Dominos Slack notifier
View _readme.md

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.

You can’t perform that action at this time.