Skip to content

Instantly share code, notes, and snippets.

View DiegoPino's full-sized avatar
💭
in between metadata and strawberry fields

Diego Pino Navarro DiegoPino

💭
in between metadata and strawberry fields
  • Metropolitan New York Library Council
  • New York, NY, USA
View GitHub Profile
@rsimon
rsimon / annotorious-opencv-find-contours.js
Last active March 1, 2024 08:00
Sample code for AnnotoriousOSD that automates polygon selection by tracing contours in the selected image section.
import OpenSeadragon from 'openseadragon';
import * as Annotorious from '@recogito/annotorious-openseadragon';
import '@recogito/annotorious-openseadragon/dist/annotorious.min.css';
/*************************************************************************
*
* Basic concept for this is from the official OpenCV docs:
* https://docs.opencv.org/3.4/dc/dcf/tutorial_js_contour_features.html
*
@thomasdullien
thomasdullien / inception_annoy.py
Created June 11, 2017 21:06
Inception for feature extraction, ANNoy for nearest-neighbor search
"""
Simple, hacked-up image similarity search using Tensorflow + the inception
CNN as feature extractor and ANNoy for nearest neighbor search.
Requires Tensorflow and ANNoy.
Based on gist code under
https://gist.github.com/david90/e98e1c41a0ebc580e5a9ce25ff6a972d
"""
from annoy import AnnoyIndex
@daniel-dgi
daniel-dgi / gist:97f6c9c618ba771ca819
Created October 15, 2015 14:02
ldp:isMemberOfRelation and Indirect Containers behaviour
~ $ curl -X POST "http://127.0.0.1:8080/fcrepo/rest/"
http://127.0.0.1:8080/fcrepo/rest/aa/71/6b/1f/aa716b1f-0021-4ed3-9179-79c4c99f9722
~ $ curl -X POST "http://127.0.0.1:8080/fcrepo/rest/"
http://127.0.0.1:8080/fcrepo/rest/b4/b8/05/e3/b4b805e3-4570-4d07-a862-ddccf7d87a00
indirect.ttl
============
@prefix ldp: <http://www.w3.org/ns/ldp#>
@prefix pcdm: <http://pcdm.org/models#>
@daniel-dgi
daniel-dgi / basic_image.php
Created October 14, 2015 01:53
Basic Image made with a wonka meme
$fedora = Chullo::create('http://127.0.0.1:8080/fcrepo/rest');
$pcdm = new Porkpie($fedora);
$uri = $pcdm->createObject();
echo $uri;
echo "\n";
$preservation_master_path = "/Users/danny/Desktop/memes_collection/condascending_wonka/oh_you're_an_engineer.jpg";
$thumbnail_path = "/Users/danny/Desktop/memes_collection/condascending_wonka/condascending_wonka_thumbnail.png";
$mods_path = "/Users/danny/Desktop/memes_collection/condascending_wonka/oh_you're_an_engineer.xml";
$standard = "http://www.loc.gov/mods/v3";
@ruebot
ruebot / deny-apim-if-not-localhost.xml
Last active August 29, 2015 14:18
If you want to import an archive context FOXML-1.1 into fcrepo3, you will need to have this setup.
<?xml version="1.0" encoding="UTF-8"?>
<Policy xmlns="urn:oasis:names:tc:xacml:1.0:policy"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
PolicyId="deny-apim-if-not-localhost"
RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable">
<Description>deny apim access if client ip address is not 127.0.0.1 (or IPv6 equivalent)</Description>
<Target>
<Subjects>
<AnySubject/>
</Subjects>
@cudevmaxwell
cudevmaxwell / Striking Out.md
Last active July 31, 2020 05:11
Striking Out with Islandora 2.x, Fedora 4.x, and Apache Camel

Striking Out with Islandora 2.x, Fedora 4.x, and Apache Camel

Kevin Bowrin, 2015-02-27

A few days ago, Nick Ruest and the Islandora Foundation made available the technical documentation for the upcoming version of Islandora. The Islandora Foundation should be commended for their transparency and community building efforts. Even in this early stage of Islandora 2.x, the documentation has a great introduction to Islandora, the goals of the project, the planned architecture, and installation instructions for their Vagrant development box.

The Technical Design for the next version of Islandora reminds me of something Mike Giarlo said, when I was waxing on about my dream Digital Library / R

@srijanshetty
srijanshetty / package-vagrant-box.md
Last active June 20, 2023 08:49
Clean up a vagrant box before packaging

We’re now going to clean up disk space on the VM so when we package it into a new Vagrant box, it’s as clean as possible. First, remove APT cache

$ sudo apt-get clean

Then, “zero out” the drive (this is for Ubuntu):

$ sudo dd if=/dev/zero of=/EMPTY bs=1M
@stain
stain / vocabulary-jsonld.json
Last active October 10, 2022 10:54
Example of how a simple OWL ontology / RDFS vocabulary could be defined with JSON-LD, defining the meaning of properties and classes. The second file shows the RDF triples of the vocabulary by using the JSON-LD sandbox. As a visualization - see http://www.essepuntato.it/lode/owlapi/https://gist.github.com/stain/7690362/raw/114f836a64291a3f894c44…
{ "@context": {
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"owl": "http://www.w3.org/2002/07/owl#",
"express": "http://example.com/express#",
"defines": {
"@reverse": "rdfs:isDefinedBy"
},
"propertyOf": {
"@id": "rdfs:domain",
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<!--
Author: Rod Page
Source: http://iphylo.blogspot.com/2011/07/correcting-ocr-using-hocr-firefox.html#comment-400434491
-->
<xsl:output method='html' version='1.0' encoding='utf-8' indent='yes'/>
<xsl:variable name="scale" select="800 div //page/@width" />
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active July 4, 2024 13:00
Backend Architectures Keywords and References