Skip to content

Instantly share code, notes, and snippets.

View niclashoyer's full-sized avatar

Niclas Hoyer niclashoyer

View GitHub Profile
@niclashoyer
niclashoyer / dabblet.css
Created October 29, 2012 12:31
Responsive Test
/*
* Responsive Test
*/
/* reset */
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}
/* stuff */
html { padding-top: 4em; counter-reset: item }
* { box-sizing: border-box }
@niclashoyer
niclashoyer / dabblet.css
Created October 21, 2012 20:16
Responsive Test
/*
* Responsive Test
*/
/* reset */
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}
/* stuff */
html { padding-top: 4em; counter-reset: item }
* { box-sizing: border-box }
@niclashoyer
niclashoyer / policies.sparql
Created August 7, 2012 22:31
SPARQL Query for SHI3LD Access Policy Selection
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX s4ac: <http://ns.inria.fr/s4ac/v2#>
SELECT DISTINCT
?m ?p ?title ?protected ?privilege ?acs ?type ?query
WHERE {{
BIND('1' AS ?m)
?p a s4ac:AccessPolicy ;
s4ac:appliesTo ?protected .
OPTIONAL {
@niclashoyer
niclashoyer / classprop.sparql
Created June 22, 2012 17:51
SPARQL Query for Retrieving Classes with Properties
PREFIX dc:<http://purl.org/dc/elements/1.1/>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX time:<http://www.w3.org/2006/time#>
PREFIX geo:<http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX foaf:<http://xmlns.com/foaf/0.1/>
PREFIX event:<http://purl.org/NET/c4dm/event.owl#>
PREFIX owl:<http://www.w3.org/2002/07/owl#>
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX vs:<http://www.w3.org/2003/06/sw-vocab-status/ns#>
select distinct ?class ?property ?label
@niclashoyer
niclashoyer / lsdumps.sh
Created June 16, 2012 11:01
Display gzipped SQL dumps from folder
#!/bin/bash
dir=/path/to/dumps
ending=sql.bz2
cd $dir
for file in *.$ending; do
time=$(date -d @`stat $file -c %Y` +%T)
size=$(du -sh $file | awk '{print $1}')
name=${file%%.$ending}
@niclashoyer
niclashoyer / githubtags.php
Created June 15, 2012 20:50
Get Tags of a GitHub Repository with links to Tarballs
#!/usr/bin/env php
<?php
$user = 'symfony';
$repo = 'symfony';
$url = 'https://api.github.com/repos/'.$user.'/'.$repo.'/tags';
$json = file_get_contents($url);
@niclashoyer
niclashoyer / ioreg-svd.py
Last active August 29, 2015 14:24
Generating ioregs! macros from SVD files
from cmsis_svd.parser import SVDParser
def getaccess(field):
if field.access == 'read-only':
return ': ro'
if field.access == 'write-only':
return ': wo'
return ''
def getoffset(field):
@niclashoyer
niclashoyer / keybase.md
Created September 22, 2014 16:52
keybase.io GitHub verification

Keybase proof

I hereby claim:

  • I am niclashoyer on github.
  • I am niclashoyer (https://keybase.io/niclashoyer) on keybase.
  • I have a public key whose fingerprint is 7693 6404 9CAC 6CED BC02 C3E4 EDCE 346C 637C 3F49

To claim this, I am signing this object:

#!/bin/bash
curl -s http://www.ndr.de/sport/live/index.html | sed -n -e 's/.*\(http:\/\/.*akamaihd.*\.m3u8\).*/\1/p'
@niclashoyer
niclashoyer / backup.sh
Last active August 29, 2015 13:57
Simple docker backup
#!/bin/bash
set -e
set -u
CONTAINER=$(docker ps -a --no-trunc | awk 'NR>1' | awk 'BEGIN {FS=" +"}; $5 ~ "^Up" {print $1}')
for C in $CONTAINER; do
echo "Backup for $C"
DATA=$(docker inspect $C)