Skip to content

Instantly share code, notes, and snippets.

@tdiprima
tdiprima / iiifUrlParser.js
Created April 2, 2021 20:44
IIIF URL Parser
// JavaScript IIIF URL Parser
// Adapted from: https://github.com/NCSU-Libraries/iiif_url/blob/master/lib/iiif_url.rb
// IIIF Image API: https://iiif.io/api/image/3.0/
function isNumeric(str) {
if (typeof str != "string") return false
return !isNaN(str) && !isNaN(parseFloat(str))
}
function parse(url) {
let w, h, identifier
@tdiprima
tdiprima / dzi_to_iiif.py
Created October 15, 2020 14:09 — forked from jpstroop/dzi_to_iiif.py
DZI syntax to IIIF
# Take params from the DZI syntax and turn them into an IIIF request
#
# Copyright (C) 2009 CodePlex Foundation
# Copyright (C) 2010-2013 OpenSeadragon contributors
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
@tdiprima
tdiprima / new_view_redo.sh
Last active June 28, 2017 15:59
Spin up a docker container
#!/bin/bash
if [ $# -eq 0 ]
then
# change to whatever default you like
IMAGE_NAME="YOUR-DOCKER-IMAGE"
CONTAINER_NAME="YOUR-DOCKER-CONTAINER"
REPO_NAME="YOUR-GITHUB-REPOSITORY" # NOTE: Name only; not the URL.
else
IMAGE_NAME="$1"