Skip to content

Instantly share code, notes, and snippets.

View schuyberg's full-sized avatar

Schuyler Lindberg schuyberg

  • The University of British Columbia
  • Vancouver, BC
View GitHub Profile
@schuyberg
schuyberg / gist:034a9982bf8326c19fc9
Last active August 29, 2015 14:21
AngularJS & EnquireJS Media Query Service
// Example Service detects a max width of 400px
// use watch & unwatch functions to set or remove breakpoint listeners
// use ismatch & notmatch functions (callbacks) to act on breakpoint changes
services.factory('max400', ['$rootScope', '$timeout', function ($rootScope, $timeout) {
var max400 = {
watch: function() { enquire.register('screen and (max-width: 400px)', max400handler); },
unwatch: function() { enquire.unregister('screen and (max-width: 400px)'); },
ismatch: function(callback) { $rootScope.$on('match400', callback); },
@schuyberg
schuyberg / dl-json-ld-collection-0.3.json
Last active December 13, 2017 11:35
Digital Library JSON-LD metadata model development
{
"@context" : "dl-json-ld-context-0.3.json",
"@id": "http://example.id/1234",
"@type": "dctypes:collection",
"_dl-id": "DL UID",
"_dl-type" : "collection",
"_created" : "COLLECTION CREATION TIMESTAMP",
{
"@context": {
"@vocab": "http://purl.org/dc/elements/1.1/",
"dcterms": "http://purl.org/dc/terms/",
"dpla": "http://dp.la/terms/",
"edm": "http://www.europeana.eu/schemas/edm/",
"geo": "http://www.w3.org/2003/01/geo/wgs84_pos#",
"lcsh": "http://id.loc.gov/authorities/subjects/",
"ore": "http://www.openarchives.org/ore/terms/",
"skos": "http://www.w3.org/2004/02/skos/core#",