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 / _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
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 / 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 {
@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 / 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 / array_benchmark.php
Last active Aug 29, 2015
Array merge benchmark
View array_benchmark.php
<?php
/*
$ php ~/test.php
Runs: 100,000
Benchmark Avg (s) Total (s)
---------- ---------- ----------
sum 0.000006 0.597605
merge 0.000007 0.713410
View gist:573794
!ENTRY org.eclipse.ui 4 4 2010-09-10 15:43:00.865
!MESSAGE Exception in org.eclipse.ui.internal.PageLayout.addView: org.eclipse.ui.PartInitException: Could not create view: net.refractions.udig.project.ui.layerManager
!STACK 1
org.eclipse.ui.PartInitException: Could not create view: net.refractions.udig.project.ui.layerManager
at org.eclipse.ui.internal.ViewFactory.createView(ViewFactory.java:158)
at org.eclipse.ui.internal.LayoutHelper.createView(LayoutHelper.java:162)
at org.eclipse.ui.internal.PageLayout.createView(PageLayout.java:543)
at org.eclipse.ui.internal.PageLayout.addView(PageLayout.java:416)
at org.eclipse.ui.internal.PageLayout.addView(PageLayout.java:390)
at uk.co.terinea.agrimark.Perspective.createInitialLayout(Perspective.java:14)
View gist:720026
function spanChars(e)
{
if (!e) e = document.body;
// Replace the text node with a span for each letter it consists of
if (e.nodeType == document.TEXT_NODE)
{
var text = e.nodeValue;
for (var c = 0; c < text.length; c++)
@icio
icio / gist:729309
Created Dec 5, 2010
largest_prime_factor
View gist:729309
<?php
test();
/**
* The largest prime factor
*
* The provided number is not considered a factor of itself.
*
* @param int $n The number we wish to find a factor of
@icio
icio / gist:766327
Created Jan 5, 2011
include_subdirectories_in_path
View gist:766327
<?php
/**
* Add each directory within ./application to the include path so that each file
* is easily accessible.
*/
function include_subdirectories_in_path()
{
global $paths;
$paths = array('application');
You can’t perform that action at this time.