Skip to content

Instantly share code, notes, and snippets.

View niclashoyer's full-sized avatar

Niclas Hoyer niclashoyer

View GitHub Profile
@niclashoyer
niclashoyer / sample gitignore for netbeans projects
Created April 12, 2011 19:18
gitignore for netbeans project that ignores generic configuration files that are generated by netbeans
#ant specific
dist/
build/
#netbeans specific
core
nbproject/*
!nbproject/project.properties
!nbproject/project.xml
@niclashoyer
niclashoyer / gen-webid-cert.sh
Created April 26, 2012 10:14 — forked from njh/_README.md
Shell script to create a WebID certificate using OpenSSL
#!/bin/sh
#
# gen-webid-cert.sh: WebID Self-signed Certificate Generator
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
@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 / 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 / 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';
@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 / createevent.sparql
Created June 28, 2012 11:54
Example SPARQL Queries for Events
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 xsd:<http://www.w3.org/2001/XMLSchema#>
PREFIX event:<http://purl.org/NET/c4dm/event.owl#>
INSERT DATA {
_:ev a event:Event ;
event:time _:time .
_:time a time:Interval ;
@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 / 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 / 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 }