Skip to content

Instantly share code, notes, and snippets.

Niklas Lindström niklasl

Block or report user

Report or block niklasl

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
niklasl /
Created Oct 28, 2017
Crude fallback when unison isn't available on your local machine. (Note that this method stores duplicates of the files of interest on the server.)
# Paths of interest
# Sync files from local device to the server landing dir
rsync -auv --delete $LOCALDIR/ $HOST:$LANDINGDIR
# Two-way-sync the landing dir with the target dir
niklasl /
Created Feb 3, 2017
Flat KBV vocabulary summary
from __future__ import unicode_literals, print_function
from rdflib import *
g = Graph().parse("")
with open('select-summary.rq') as f:
select =
print('Term', 'Bases', 'Domain', 'Range', sep='\t')
for row in g.query(select):
niklasl / illustrated-text-class.ttl
Created Oct 7, 2016
Just an OWL sketch for possibly inferring some BibFrame details from other details...
View illustrated-text-class.ttl
prefix : <>
prefix bf: <>
prefix kbv: <>
prefix marcrel: <>
kbv:IllustratedText a :Class;
:equivalentClass [
:intersectionOf (
[ a :Restriction;
niklasl /
Last active May 30, 2016
Get SAOGF from
#!/usr/bin/env python3
from urllib.parse import urljoin
from urllib.request import urlopen, Request
import json
import codecs
reader = codecs.getreader("utf-8")
def crawl(collection_url):
while True:
View synesthesia.js
* To level up your synesthesia, choose colors, apply on web pages and read
* some 100 000 words. Purportedly. :)
var charColorMap = {
a: 'darkred',
e: 'green',
s: 'blue',
import string
import math
CHARS = string.digits + string.lowercase
assert len(CHARS) == 36
CHARS += string.uppercase
assert len(CHARS) == 62
BASE64_CHARS = string.uppercase + string.lowercase + string.digits + "+/"
niklasl /
Last active Dec 30, 2015
Generates a JSON-LD Context for
from rdflib import *
SDO = Namespace("")
datatype_coerce_map = {
#SDO.Number: XSD.double,
SDO.Date: 'xsd:date',
SDO.DateTime: "xsd:dateTime",
View rdfa-about-table.html
<!DOCTYPE html>
<title>Using about with a table</title>
<table vocab="">
niklasl / schemabibex-examples-dcterms.ttl
Created Jul 16, 2013
Using the Dublin Core terms isFormatOf and isVersionOf to interlink some SchemaBibEx examples
View schemabibex-examples-dcterms.ttl
@prefix owl: <> .
@prefix xsd: <> .
@prefix skos: <> .
@prefix dc: <> .
@prefix foaf: <> .
@prefix pto: <> .
@prefix : <> .
## Altered parts of <> ##
niklasl / pres.mkd
Created Jan 10, 2013
Scripting Vim - From Moves to Tools [A Vim Presentation]
View pres.mkd

Scripting Vim - From Moves to Tools

  • Customizing Vim
  • Mappings
  • Commands
  • Batching with Vim
  • Case: plugin

You can’t perform that action at this time.