Skip to content

Instantly share code, notes, and snippets.

View edsilv's full-sized avatar

Edward Silverton edsilv

View GitHub Profile
@donmccurdy
donmccurdy / THREE_COLORSPACE_MANAGEMENT.md
Last active January 2, 2023 08:07
Color management in three.js
@tomcrane
tomcrane / uv-discuss.md
Last active March 11, 2019 10:33
Universal Viewer Discussion Documents
@elebetsamer
elebetsamer / st-generate.js
Last active July 26, 2018 15:05 — forked from mlynch/generate.js
Stencil component generator
/*
To setup, place in scripts/st-generate.js and add
"st:generate": "node scripts/st-generate.js"
To your npm scripts.
To generate a component in src/components/ run
npm run st:generate component my-component
@tomcrane
tomcrane / av-api.md
Last active July 2, 2021 12:00
The IIIF AV API and its relationship with the Presentation API

This gist has been superseded by this Google Doc:

http://bit.ly/av-issues

What are Audio and Video Content APIs?

This document starts with a quick recap of IIIF Presentation and Image APIs, to help probe what is different for time-based media in the context of use cases and existing community practice for A/V today. It assumes that there is only one Presentation API, otherwise we can't have mixed-media manifests (a recurring use case and aspiration). It is based on the discussions in The Hague, in the AV Github issues and use cases, and on AV working group calls.

Introduction/recap - access to content via the Presentation API today

@tomcrane
tomcrane / Thumbnail-Selection.md
Last active December 7, 2018 02:45
Thumbnail selection algorithm

getThumbnail(..)

Motivation

Generally, to encapsulate the logic for getting the best possible thumbnail for a resource, given the user's current known auth status for those resources. Anyone using manifesto or some other library that implements this can just call getThumbnail(..) and not worry about the details. Most of the time auth is not an issue, but if it is, they still don't need to worry about the details, getThumbnail(..) will figure it out and return the best thumbnail the user can currently see (which may be no thumbnail). Crucially, getThumbnail() assumes that the best thumbnail is the FASTEST one, within reason; that viewers favour speed over a precise size because they can scale an image in the browser.

Specifically, to help viewers generate a "field" of thumbnails as quickly as possible. Mirador, UV and other viewers all show large numbers of thumbnails at once. This can give a poor user experience, especially if viewers ask for arbitrary image sizes which

@tinybike
tinybike / ipfs-helper.sh
Last active December 10, 2015 12:55
go-ipfs setup helper script
#!/bin/bash
# go-ipfs setup helper
# @author Jack Peterson ([email protected])
set -e
trap "exit" INT
IPFS_BIN="/usr/local/bin/ipfs"
IPFS_LOG="/var/log/ipfs.log"
IPFS_UPSTART="/etc/init/ipfs.conf"
@xjamundx
xjamundx / blog-webpack-2.md
Last active November 7, 2024 13:10
From Require.js to Webpack - Part 2 (the how)

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.

@tomcrane
tomcrane / WDL-IxIF.md
Last active July 31, 2020 05:11
Wellcome Library IxIF "Interim" implementation

We want to move the Wellcome Library away from the Wellcome Player and onto the IIIF 2.0 Universal Viewer (UV).

This allows us to move all the Wellcome Library's image API endpoints to the protoype DLCS (Digital Library Cloud Services) that we have started building.

We have a problem. We have video, audio and born-digital content, besides image sequence content. We don't want to maintain the Player and the UV together. This non-image content is a tiny fraction of the total, but an important one.

Other institutions share this problem, and everyone agrees that IIIF will need to extend to handle non-image-sequence resources - "IxIF". We want to inherit all that we can from IIIF - the JSON-LD, the Open Annotation model, the manifest wrapper and general approach to metadata ("presentation not semantics"). Shared Canvas may be appropriate for some media but not others.

  • Images are canvas-based media - they occupy a region of a plane. Annotations are on regions of the plane.
  • Audio is a time-based medium - i
@mdasberg
mdasberg / pre-and-post-grunt-hook.js
Last active March 8, 2019 15:13
Pre-execution and post-execution "hooks" for Grunt
var grunt = require('grunt');
var hooker = require('hooker');
module.exports = preAndPostHook = function () {
var currentTask = undefined;
/**
* Do something when the task has sta.
* @param taskName The task name.
*/
@diverted247
diverted247 / gulpfile.js
Created May 1, 2014 18:15
A Gulp + TypeScript + Component Build script
var gulp = require( 'gulp' ),
component = require( 'gulp-component' ),
tsc = require( 'gulp-typescript-compiler' );
gulp.task( 'default' , [ 'ts' ] , function (){
gulp.src( 'component.json' )
.pipe( component( {
standalone: true
} ) )
.pipe( gulp.dest( 'build' ) )