Skip to content

Instantly share code, notes, and snippets.

View nichtich's full-sized avatar
🦊
not a fox

Jakob Voß nichtich

🦊
not a fox
View GitHub Profile
@nichtich
nichtich / testumlauts.pl
Created November 7, 2011 09:31
Umlauts in RDF/Turtle URIs
#!/usr/bin/perl
use utf8;
use RDF::Dumper;
use RDF::Trine::Model;
use RDF::Trine::Serializer;
use RDF::Trine qw(iri);
my $m = RDF::Trine::Model->new;
my $p = RDF::Trine::Parser->new('turtle');
@nichtich
nichtich / databases.sql
Created December 16, 2011 21:56
Get data from Sony PRS-T1
-- Get highlighted parts
-- in /media/READER/Sony_Reader/database/books.db:
SELECT file_name, page, name FROM markups;
@nichtich
nichtich / gist:1560990
Created January 4, 2012 17:03
Expressing IPs and IP-Ranges as URIs
An IP uniquely identifies a resource, so it should be usable as URI. Unfortunately there is no URI namespace for IP and/or IP ranges.
IP:
(((([1-9]?\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}([1-9]?\d|1\d{2}|2[0-4]\d|25[0-5]))|((([\da-fA-F]{1,4})|(\:))\:){7}(([\da-fA-F]{1,4})|(\:))))
CIDR IP range (see http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing):
(((([1-9]?\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}([1-9]?\d|1\d{2}|2[0-4]\d|25[0-5])\/(\d|[1-2]\d|3[0-2]))|((([\da-fA-F]{0,4})|(\:))\:){7}(([\da-fA-F]{0,4})|(\:)))\/([1-9]?\d|1[01]\d|12[0-8])))
@nichtich
nichtich / parse.pl
Created January 31, 2012 15:05
dewiki-category
#!/usr/bin/perl
#
# Extract all category names from german Wikipedia database dump
# http://dumps.wikimedia.org/dewiki/latest/dewiki-latest-category.sql.gz
#
# bzcat dewiki-latest-category.sql.gz | ./parse.pl
#
use strict;
while (<>) {
@nichtich
nichtich / campain.json
Created May 20, 2012 07:43
unglue.it API
{
"meta":{
"limit":20,
"logged_in_username":null,
"next":null,
"offset":0,
"previous":null,
"total_count":6
},
"objects":[
#!/bin/bash
# version 20120611
# author: dr0ide
# Copyright 2011 dr0ide. The program is distributed under the terms of
# the GNU General Public License, see https://www.gnu.org/licenses/gpl-3.0.html
#
#TODO:
# 1. if http://de.dbpedia.org/ontology/wikiPageRedirects exists then fetch it.
# because only there resides the information if it is "wikiPageDisambiguates" ,
# e.g. http://de.dbpedia.org/resource/Bücherei , respectively said property is NOT
@nichtich
nichtich / imagesize.pl
Created August 3, 2012 11:24
convert image print size
#!/usr/bin/perl
use strict;
use 5.10.0;
my ($mx, $my); # requested print size
unless( @ARGV ) {
say 'imagesize { file | dimension }+';
say '';
say ' Image sizes in pixels and mm are shown for each file.';
@nichtich
nichtich / gbv.owl.ttl
Created August 13, 2012 11:01
GBV Ontology
#################################################################
# URI Prefixes
#################################################################
@prefix : <http://purl.org/ontology/gbv/> .
@prefix gbv: <http://purl.org/ontology/gbv/> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix ns: <http://www.w3.org/2003/06/sw-vocab-status/ns#> .
@nichtich
nichtich / raspi.svg
Created September 19, 2012 07:14
My Inofficial Raspberry Pi logo based on then USB logo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nichtich
nichtich / parsefeed.pl
Created October 23, 2012 09:01
Fetch collection of Thesaurus description from http://thesaurusportal.blogspot.com
#!/usr/bin/perl
use v5.14;
use XML::Atom::Feed;
use XML::Atom::Util;
use XML::LibXML;
use HTML::Parser;
use HTML::TreeBuilder::XPath;
use URI;