Skip to content

Instantly share code, notes, and snippets.

Natanael Arndt white-gecko

Block or report user

Report or block white-gecko

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
View quit-blank-sketchbook
-> Menge von AtomicGraph
-> Menge von ComparableGraph
-> Menge von AtomicGraph
=> Blank Node Scope beschränkt auf einen Graph
-> Menge von AtomicDatasets
white-gecko / dataset-construct-literal.sparql
Last active Nov 13, 2019
If you want to query a complete dataset with a single construct query.
View dataset-construct-literal.sparql
PREFIX ex: <>
?s ?p ?o .
?g a ex:Graph ;
ex:hasData ?datalit .
?s ?p ?o .
white-gecko /
Last active Nov 7, 2019
sqlite python example
#!/usr/bin/env python3
# starting with
import sqlite3
conn = sqlite3.connect('example.db')
c = conn.cursor()
c.execute("DROP TABLE IF EXISTS stocks")
c.execute("DROP TABLE IF EXISTS stuff")
white-gecko /
Created Oct 31, 2019
Play around with a hashable and comparable object in python
#!/usr/bin/env python3
class mE():
def __init__(self, value):
self.v = value
# we need __hash__ and __eq__ for the set
def __hash__(self):
# the maximum length of hash is restricted by the platform:
white-gecko /
Created Mar 12, 2018 backup script
#!/usr/bin/env bash
cd /home/seebi/backups
echo "dump_one_graph ('', '/tmp/akswdump_', 1000000000);" | isql-vt -U dba -P "the_password" >/dev/null
cp /tmp/akswdump_000001.ttl
rapper -q -i turtle -o turtle /tmp/akswdump_000001.ttl >
rapper -q -i turtle -o ntriples | sort >
echo "dump_one_graph ('http://localhost/OntoWiki/Config/', '/tmp/owconfigdump_', 1000000000);" | isql-vt -U dba -P "the_password" >/dev/null
rapper -q -i turtle -o turtle /tmp/owconfigdump_000001.ttl >owconfig.ttl
rapper -q -i turtle -o ntriples owconfig.ttl | sort >owconfig.nt
"""Untill is merged and released."""
from rdflib import Graph, BNode, URIRef
from six.moves.urllib.parse import urljoin
def bNodeSkolemize(self, authority=None, basepath=None):
white-gecko / docker-env
Created Aug 7, 2015
Docker environment management with $DOCKER_ENV
View docker-env
list ()
echo "local"
echo "remote1"
env_remote1 ()
export DOCKER_HOST=""
white-gecko /
Created Jul 8, 2015
Python Default Dictionary of Dictionaries
#! /usr/bin/env python3
from collections import defaultdict
def ddict ():
return defaultdict(ddict)
def ddict2dict(d):
for k, v in d.items():
if isinstance(v, dict):
white-gecko / gecko.zsh-theme
Last active Aug 29, 2015
My zsh theme (you have to place it in ~/.oh-my-zsh/themes/ and change ZSH_THEME to gecko in your .zshrc)
View gecko.zsh-theme
# this theme was build be taking some code and impressions from mortalscumbag, intheloop, crcandy and bureau
bureau_git_branch () {
ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
echo "${ref#refs/heads/}"
bureau_git_status () {
_INDEX=$(command git status --porcelain -b 2> /dev/null)
You can’t perform that action at this time.