Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
"""
Get user_ids for followers of a particular account:
% ./followers_ids.py jack > ids.txt
"""
@Rarian
Rarian / Islandora Scholar Patch
Last active November 8, 2016 13:18
Hack-ish patches for Islandora 1.7 with Fedora 3 and trippi-sparql talking to Fuseki
diff --git a/modules/islandora_scholar_embargo/islandora_scholar_embargo.module b/modules/islandora_scholar_embargo/islandora_scholar_e
index a0d3bc7..36f6937 100644
--- a/modules/islandora_scholar_embargo/islandora_scholar_embargo.module
+++ b/modules/islandora_scholar_embargo/islandora_scholar_embargo.module
@@ -210,8 +210,8 @@ WHERE {
?embargoed is:$eu ?date ;
is:$np ?notify .
FILTER(
- ?notify < '$now'^^xsd:dateTime &&
- ?date > '$pre_expiry'^^xsd:dateTime) .
<?php
function getCollectionData($collection_pid) {
$user = user_load(1);
$repository = islandora_get_tuque_connection($user);
$query = <<<EOQ
SELECT ?pid ?label ?cmodel
FROM <#ri>
WHERE {
?pid <info:fedora/fedora-system:def/relations-external#isMemberOfCollection> <info:fedora/$collection_pid> ;
<fedora-model:label> ?label ;
@tobilg
tobilg / custom_s3_endpoint_in_spark.md
Last active May 22, 2023 14:57
Description on how to use a custom S3 endpoint (like Rados Gateway for Ceph)

Custom S3 endpoints with Spark

To be able to use custom endpoints with the latest Spark distribution, one needs to add an external package (hadoop-aws). Then, custum endpoints can be configured according to docs.

Use the hadoop-aws package

bin/spark-shell --packages org.apache.hadoop:hadoop-aws:2.7.2

SparkContext configuration

@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";
@cmharlow
cmharlow / YorkUnivDigLibrary.txt
Last active October 13, 2015 20:16
York University Digital Library MODS QA Report (just playing around by Christina)
mods:abstract: |====================== | 22820/25050 | 91%
mods:accessCondition: |===================== | 21213/25050 | 84%
mods:classification: | | 328/25050 | 1%
mods:genre: |======================= | 24037/25050 | 95%
mods:identifier: |======================== | 24966/25050 | 99%
mods:language: | | 51/25050 | 0%
mods:language/mods:languageTerm: |================= | 17787/25050 | 71%
mods:location/mods:physicalLocation: |==================== | 20955/25050 | 83%
mods:location/mods:url: | | 791/25050 | 3%
@hectorcorrea
hectorcorrea / frbr.md
Last active August 29, 2015 14:24
Notes from FRBR + Fedora + Inheritance meeting

FRBR + Fedora + Inheritance

My notes from the Google Hangout organized by Christina Harlow (@cm_harlow) on 7/14/2015

Keep in mind that I captured this as the video call went on and I might have gotten some of it wrong. I'll update this page with a link to the recording once it becomes available.

What is FRBR?

FRBR (Functional Requirements for Bibliographic Records) is a 1998 recommendation of the International Federation of Library Associations and Institutions (IFLA) to restructure catalog databases to reflect the conceptual structure of information resources. - http://www.oclc.org/research/activities/frbr.html

@lawlesst
lawlesst / fuseki-fulltext-config.ttl
Last active November 15, 2021 16:45
Minimal working Fuseki TDB with with full text search.
@prefix : <http://localhost/jena_example/#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix text: <http://jena.apache.org/text#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
## Example of a TDB dataset and text index
## Initialize TDB
@no-reply
no-reply / thoughts.md
Last active March 23, 2017 20:09
Records, Documents, & Graphs: Accounting for record scope & mutability in metadata management

Records, Documents, & Graphs

Accounting for record scope & mutability in metadata management.

Smoothies cannot be edited @anarchivist -- 6:52 PM PDT - 23 Apr 2015

Questions

The key question I'm setting out to answer is: How can we account for routine change and updates in our metadata records. An initial attempt to derive a model for change from current practice has led to some corollary questions about the relationship between Records, Documents, Description Sets, Application Profiles, Resources, and RDF Sourceslit review:

@edsu
edsu / grid.md
Last active August 29, 2015 14:13

Started grid job on trusty.tools.wmflabs.org:

jstart -l release=trusty -N anon /usr/bin/node anon/anon.js --config /data/project/anon/config.json --verbose

But seeing this in /data/project/anon/anon.err

FATAL ERROR: v8::Context::New() V8 is no longer usable
/var/spool/gridengine/execd/tools-exec-12/job_scripts/7335380: line 4:  7662 Aborted                 (core dumped) /usr/bin/nodejs /data/project/anon/anon/anon.js --config /data/project/anon/config.json --verbose

What's weird is that running the job manually on trusty.tools.wmflabs.org with the command in the error seems to work fine: