Skip to content

Instantly share code, notes, and snippets.

View gist:670d6f55e53acd986b89accc69a42fe0
#!/usr/bin/env python
import re
import sys
e = 0
w = 0
def exxx(m):
global e
e += 1
View gist:221ab481ee9110a6ca690eadb126736c
"@context": "",
"id": "urn:ark:/12345/bbb11ccc22",
"type": "Object",
"hashAlgorithm": "sha512",
"versions": [{
"type": "Version",
"id": "#v1",
"created": "2014-01-01T12:00:00Z",
"message": "Initial version",
zimeon / gist:a4b02fe70b4f3fba0f07681f2422021a
Created Jan 5, 2018
Shell session creating LDP-NR with fcrepo4 and inspecting results
View gist:a4b02fe70b4f3fba0f07681f2422021a
simeon@RottenApple ~> curl -i -X POST -H "Content-Type: text/plain" -H "Slug: a" http://localhost:8080/rest --data "hello"
HTTP/1.1 201 Created
Date: Fri, 05 Jan 2018 18:49:14 GMT
ETag: "36d0d1ed6ee9c7d7cad5b5d2970f3f6c490c5857"
Last-Modified: Fri, 05 Jan 2018 18:49:14 GMT
Link: <http://localhost:8080/rest/a/fcr:metadata>; rel="describedby"; anchor="http://localhost:8080/rest/a"
Location: http://localhost:8080/rest/a
Content-Type: text/plain
Content-Length: 28
Server: Jetty(9.2.3.v20140905)
zimeon /
Created Aug 30, 2017
How does the `node-solid-server` handle WAC ACLs?

The node-solid-server implements WAC ACLs using simple append of .acl to the resource URI. It seems to consistently return a URI with .acl appended to in Link: <...>; rel="acl" even if the resource being requested does not exist or is already and ACL!

Easy download and run:

mkdir solid
cd solid
npm install -g solid-server
# generate key for local use
openssl genrsa 2048 > localhost.key
View info.json
"thumbnail": {
"format": "image/jpeg",
"height": 480,
"width": 720,
"service": {
"profile": "",
"@context": "",
"id": ""
zimeon / gist:8fadd1fef051ebee0b8b75b8c470b089
Last active Oct 20, 2016
Video info.json using approach of describing files/resources that exist
View gist:8fadd1fef051ebee0b8b75b8c470b089
"@id": "",
// Profile says we are level0 so there is no construction of a URI
"profile": "",
// Here we describe the abstract source
"width": 2000,
"height": 2000,
"duration": 63,
// Here we map certain files that maybe versions of the whole video with
zimeon /
Last active Aug 29, 2015
Test of iiif static files with previously problematic image


Image now at , grabbed:

simeon@RottenApple iiif>wget
--2015-07-23 17:30:45--
Connecting to||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3589041 (3.4M) [image/jpeg]
zimeon /
Created Oct 7, 2014
Code for arXiv resync experiment
#!/usr/bin/env python
"""Update script for arXiv experiment on
It is assumed that the files for abs and src will have been
updated before the script is run. The the sequence is:
- build an resourcelist in /arxiv/YYYY-MM-DD/resourcelist.xml etc
- build a changelist in /arxiv/YYYY-MM-DD/changelist.xml etc
- copy resourcelist and changelist to /arxiv/resourcelist.xml, /arxiv/changelist
zimeon / gist:8baf705e983e84f5ab3e
Created Jul 25, 2014
IIIF w, size calculation
View gist:8baf705e983e84f5ab3e
simeon@RottenApple image_api_size_calc>more
#!/usr/bin/env python
# In OSD Jon uses:
# width_to_request = int(float(desired_height) / image_height * image_width)
# see
matches = 0
for iw in (1,80,200,1234,5678,10567,678991):
for ih in (1,80,200,1234,5678,10567,678991):
zimeon / gist:11273436
Last active Aug 29, 2015
Trying out rdf-4store with Ruby RDF
View gist:11273436

Goal is to try out 4store plugin for Ruby RDF. Was playing with Ruby 2.1.1 under rvm and assuming RDF already installed. Working on a Mac.

Grab current rdf-4store, seems that last commit was Oct 2013, about half a year ago:

simeon@RottenApple ldcx-play>git clone
Cloning into 'rdf-4store'...
remote: Counting objects: 169, done.
remote: Compressing objects: 100% (98/98), done.
remote: Total 169 (delta 44), reused 169 (delta 44)
Receiving objects: 100% (169/169), 76.71 KiB, done.
You can’t perform that action at this time.