Skip to content

Instantly share code, notes, and snippets.

View RubenVerborgh's full-sized avatar

Ruben Verborgh RubenVerborgh

View GitHub Profile
@RubenVerborgh
RubenVerborgh / results.log
Created August 27, 2015 11:49
IRI resolution of different Turtle parsers
A. Resolving without leading ./ or ../
BASE http://example.org/xxx/yyy/zzz, resolving aaa/bbb/ccc
EYE http://example.org/xxx/yyy/aaa/bbb/ccc
cwm http://example.org/xxx/yyy/aaa/bbb/ccc
N3.js http://example.org/xxx/yyy/aaa/bbb/ccc
Serd http://example.org/xxx/yyy/aaa/bbb/ccc
B. Resolving with non-leading ./ or ../
BASE http://example.org/xxx/yyy/zzz, resolving aaa/./bbb/ccc
@RubenVerborgh
RubenVerborgh / paper.tex
Created February 8, 2014 11:15
Decrease space above copyright notice
\documentclass{sig-alternate-2013}
% Fix for copyright block height
\makeatletter
\def\@copyrightlength{2.5} % Increase this value to leave more space above copyright notice
\def\ftype@copyrightbox{8}
\def\@copyrightspace{
\@float{copyrightbox}[b]
\begin{center}
\setlength{\unitlength}{1pc}
@RubenVerborgh
RubenVerborgh / acronyms.tex
Created December 4, 2014 09:15
Easily typeset acronyms
\usepackage{xspace}
\newcommand\Acronym[1]{%
\expandafter\def\csname#1\endcsname{{\scshape #1}\xspace}%
\expandafter\def\csname#1s\endcsname{{\scshape #1}s\xspace}%
}
\Acronym{api}
\Acronym{rest}
\Acronym{sparql}
\sparql is not a \rest \api.
# Without content negotiation, we get back an invalid content type
$ curl -LI http://rdf.ebi.ac.uk/dataset/atlas/13.07
HTTP/1.1 303 See Other
Server: Apache/2.2.15 (Red Hat)
Content-Type: text/html; charset=iso-8859-1
Date: Wed, 04 Feb 2015 11:36:31 GMT
Location: https://www.ebi.ac.uk/rdf/services/atlas/servlet/explore?uri=http://rdf.ebi.ac.uk/dataset/atlas/13.07
Transfer-Encoding: chunked
Connection: Keep-Alive
@RubenVerborgh
RubenVerborgh / fragment.trig
Last active August 29, 2015 14:21
Example Triple Pattern Fragment
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX dc11: <http://purl.org/dc/elements/1.1/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
Verifying that +rubenverborgh is my blockchain ID. https://onename.com/rubenverborgh
@RubenVerborgh
RubenVerborgh / sparqljs-browser.js
Created October 27, 2015 16:18
SPARQL.js 1.1.3 browser version
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.sparqljs = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
},{}],2:[function(require,module,exports){
(function (process){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to
@RubenVerborgh
RubenVerborgh / fragment.json
Last active October 29, 2015 10:39
Triple Pattern Fragments after paging property changes
{
"@context": {
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"owl": "http://www.w3.org/2002/07/owl#",
"skos": "http://www.w3.org/2004/02/skos/core#",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"dc": "http://purl.org/dc/terms/",
"dcterms": "http://purl.org/dc/terms/",
"dc11": "http://purl.org/dc/elements/1.1/",
@RubenVerborgh
RubenVerborgh / chai-as-promised-and-chai-things.coffee
Last active December 10, 2015 18:58
Chai as Promised and Chai Things didn't work nicely together.
#!/usr/bin/env mocha --compilers coffee:coffee-script --reporter spec
(require "mocha-as-promised")()
chai = require "chai"
Q = require "q"
chai.should()
chai.use require "chai-as-promised"
chai.use require "chai-things"
array = [{ a: 1 }, { b: 2 }]
arrayPromise = Q.resolve(array)
@RubenVerborgh
RubenVerborgh / chai-as-promised-performance.js
Last active December 10, 2015 21:18
Chais as Promised performance issues
#!/usr/bin/env mocha --reporter spec --timeout 5000
var chai = require("chai");
var Q = require("q");
chai.should();
chai.use(require("chai-as-promised"));
describe("The string", function() {
it("should eventually be string", function() {
'x'.should.be.a('string');
});