Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View niclashoyer's full-sized avatar

Niclas Hoyer niclashoyer

View GitHub Profile
@niclashoyer
niclashoyer / hipache-docker
Last active December 28, 2015 06:19
Shell script to start a docker container and add it to hipache
#!/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 / gist:7012182
Created October 16, 2013 18:07
Get all postboxes around Kiel, Germany
http://overpass.osm.rambler.ru/cgi/interpreter?data=[out:json];node[name%3DKiel]%3Bnode%28around%3A10000%29[amenity%3Dpost_box]%3Bout%3B
@niclashoyer
niclashoyer / ldpcontainer.coffee
Created August 28, 2013 21:46
minimal in-memory nodejs ldp container implementation (incomplete)
# npm install connect
connect = require 'connect'
accept = [
'text/turtle',
'application/rdf+xml',
'application/rdf+json'
]
@niclashoyer
niclashoyer / _echoimap.md
Last active December 20, 2015 21:19
IMAP mail retriever written in CoffeeScript to forward mail to another process.

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 December 19, 2015 17:29
colour-light style for gedit
<?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 June 6, 2013 20:27
Remove all Docker Containers
#!/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 10:59
SPARQL query to get the "height" or distance to a common parent class.
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 December 10, 2015 21:18
Syntax highlighting for Literate CoffeeScript in gtksourceview, e.g. gedit.
<?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.

Dependencies

sudo dnf install git qt5-qtbase-devel qt5-qtsvg-devel qt5-qtserialport-devel

Building

@niclashoyer
niclashoyer / config.php
Created June 16, 2012 16:51
Get Magento Configurations as XML
<?php
/*
Put this file to /magento/shell/config.php and run
$ php shell/config.php | tidy -xml -i > config.xml
*/
require_once 'abstract.php';