Skip to content

Instantly share code, notes, and snippets.

Patrick Hochstenbach phochste

Block or report user

Report or block phochste

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
phochste / gist:debdedb18d55b6d4d711d8cb9841f5ea
Last active Jan 5, 2020
How to extract two sub images from a larger image?
View gist:debdedb18d55b6d4d711d8cb9841f5ea
I have an image which contains two rectangular regions which contains stereotype photos. What is the best way
for a large batch of photos to extract automatically the two photos in the original source?
View gist:a183b58e8bbeac64a6f49d1d9e639051
"coord": {
"lon": 139.76,
"lat": 35.68
"weather": Array[1][
"id": 802,
"main": "Clouds",
"description": "scattered clouds",
View Catmandu::Fix::holding
# Usage:
# marc_marc('852a',holding.$append)
# holding(-logfile => '/mnt/scratch/lludss/holding_error.txt')
package Catmandu::Fix::holding;
use strict;
use Catmandu::Util qw(:io is_string);
use POSIX qw(strftime);
use Data::Dumper;
View weather.json
{"coord":{"lon":3.72,"lat":51.05},"sys":{"type":3,"id":4839,"message":0.0349,"country":"BE","sunrise":1417159365,"sunset":1417189422},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"base":"cmc stations","main":{"temp":281.15,"pressure":1006,"humidity":87,"temp_min":281.15,"temp_max":281.15},"wind":{"speed":3.6,"deg":100},"rain":{"3h":0.5},"clouds":{"all":56},"dt":1417166878,"id":2797656,"name":"Gent","cod":200}
View weather.json
{"coord":{"lon":3.72,"lat":51.05},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"base":"cmc stations","main":{"temp":288.524,"pressure":1034.03,"humidity":87,"temp_min":288.524,"temp_max":288.524,"sea_level":1036.43,"grnd_level":1034.03},"wind":{"speed":6.93,"deg":242.008},"rain":{"3h":0.2025},"clouds":{"all":92},"dt":1447164399,"sys":{"message":0.0031,"country":"BE","sunrise":1447138397,"sunset":1447171449},"id":2797656,"name":"Gent","cod":200}
phochste /
Created Jun 3, 2015
Match authors against VIAF using Catmandu and Linked Data Fragments
#!/usr/bin/env perl
# Match authors against VIAF
# License:
# Author: Patrick Hochstenbach <>
# Apr 2015
View turtle2ntriples.js
#!/usr/bin/env node
* Install: npm install n3
* Usage: cat gigantic.ttl | tutle2ntriples
* Usage: tutle2ntriples gigantic.ttl
* See also:
var file = undefined;
if (process.argv.length == 2) {
View gist:5775ec69205db377c4b3
use Catmandu;
my $var = '';
my $exporter = Catmandu->exporter('JSON', file => \$var);
$exporter->add({ 'aaargh' => 'doedoedoe' });
print $var;
phochste / gist:9d4f2fea85b41de7f563
Created Jun 17, 2014
Catmandu ElasticSearch error handler
View gist:9d4f2fea85b41de7f563
use Catmandu;
use Data::Dumper;
my $importer = Catmandu->importer('Mock');
# Create a store with a vey strict schema that always produces errors ...
my $store = Catmandu->store('ElasticSearch',
index_name => 'test2',
bags => { data => {
View gist:5443471
Hello Gwen
How are you!! d sfkhushf s fksuhf ksuhfsalkufhusfkuhkhweuh fkudhauhf ahsdkufs f
slfsdif jslfijsfi jslfijsfijosjfs;ifsij s
You can’t perform that action at this time.