Skip to content

Instantly share code, notes, and snippets.

Niclas Hoyer niclashoyer

  • Kiel, Germany
Block or report user

Report or block niclashoyer

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
@niclashoyer
niclashoyer / hipache-docker
Last active Dec 28, 2015
Shell script to start a docker container and add it to hipache
View hipache-docker
#!/bin/bash
# The MIT License (MIT)
#
# Copyright (c) <year> <copyright holders>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@niclashoyer
niclashoyer / 00-fedora-studio.md
Last active Aug 8, 2016
Fedora 19 Studio Setup
View 00-fedora-studio.md

Fedora Studio Setup

@niclashoyer
niclashoyer / gist:7012182
Created Oct 16, 2013
Get all postboxes around Kiel, Germany
View gist:7012182
http://overpass.osm.rambler.ru/cgi/interpreter?data=[out:json];node[name%3DKiel]%3Bnode%28around%3A10000%29[amenity%3Dpost_box]%3Bout%3B
@niclashoyer
niclashoyer / dexdis.coffee
Last active Jan 17, 2018
Quick hack for a redis like interface for IndexedDB
View dexdis.coffee
errs =
transaction: 'Operation not allowed during transaction'
wrongtype: 'Operation against a key holding the wrong kind of value'
notransaction: 'Operation not allowed without transaction'
notsupported: 'Operation not supported'
toomuchop: 'Operation with too much operands'
# calculate hamming weight (for BITCOUNT command)
# see http://jsperf.com/hamming-weight/4
hamming = (x) ->
@niclashoyer
niclashoyer / ldpcontainer.coffee
Created Aug 28, 2013
minimal in-memory nodejs ldp container implementation (incomplete)
View ldpcontainer.coffee
# npm install connect
connect = require 'connect'
accept = [
'text/turtle',
'application/rdf+xml',
'application/rdf+json'
]
@niclashoyer
niclashoyer / _echoimap.md
Last active Dec 20, 2015
IMAP mail retriever written in CoffeeScript to forward mail to another process.
View _echoimap.md

echoimap

Create a settings file ~/.echoimap.json with the following content:

{
	"imap": {
		"host": "imap.example.com",
		"user": "imapuser",
		"password": "imappassword",
@niclashoyer
niclashoyer / colour-light.xml
Last active Dec 19, 2015
colour-light style for gedit
View colour-light.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- save to ~/.local/share/gtksourceview-3.0/styles/ -->
<!--
The MIT License (MIT)
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy
@niclashoyer
niclashoyer / docker-cleanup.sh
Created Jun 6, 2013
Remove all Docker Containers
View docker-cleanup.sh
#!/bin/bash
containers=`sudo find /var/lib/docker/graph/ -maxdepth 1 -type d -printf "%f "`
docker rmi $containers
@niclashoyer
niclashoyer / height.sparql
Created May 5, 2013
SPARQL query to get the "height" or distance to a common parent class.
View height.sparql
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ldp: <http://www.w3.org/ns/ldp#>
PREFIX : <http://example.com#>
SELECT ?r (MIN(?h) AS ?height) WHERE {
VALUES ?r { :h0 :h1 :h2 :h3 :h4 :h5 :h6 }
VALUES ?p { ldp:Resource }
{
?r rdf:type ?p
@niclashoyer
niclashoyer / literate_coffee_script.lang
Last active Dec 10, 2015
Syntax highlighting for Literate CoffeeScript in gtksourceview, e.g. gedit.
View literate_coffee_script.lang
<?xml version="1.0" encoding="UTF-8"?>
<!--
Author: Niclas Hoyer <niclas@verbugt.de>
Copyright (C) 2012 Niclas Hoyer <niclas@verbugt.de>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
You can’t perform that action at this time.