Skip to content

Instantly share code, notes, and snippets.

🏗
in the maintenance mines 👷‍♂

Jessie Keck jkeck

🏗
in the maintenance mines 👷‍♂
Block or report user

Report or block jkeck

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View atom-snippet.cson
'.source.ruby':
'initialize':
'prefix': 'init'
'body': """
def initialize($1)
$2
end$3
"""
'require':
'prefix': 'req'
@jkeck
jkeck / spotlight-iiif-proposal.md
Last active Jan 13, 2017
A brief proposal (and some other notes) on implementing IIIF cropping in Spotlight
View spotlight-iiif-proposal.md

In order to support IIIF cropping of multi-image objects (which is currently supported in a non-IIIF way), we'll need to use IIIF manifests. Storing a list of info.json URLs will not be sufficient since the URL typically contains the file name of the item (at least in our case). This is potentially volatile in the case of remediations that changes file names. A IIIF manifest has references to the images contained within an object (as well as unique identifiers that we can use that will not change during remediation). This will require some changes that are outlined below.

Persisted Data

Currently we persist the URL to the masthead/thumbnail image itself (the act of submitting a crop selection for a masthead/thumbnail causes a fetch of the full image and does the image cropping server side). We still want to persist a URL to an image so we don't have to hit the IIIF service to get the cropped image URL, however we will need to persist some other data from the IIIF manifest to ensure that we're referencin

@jkeck
jkeck / test_faraday_timeout.rb
Last active May 18, 2016
Faraday Timeout Example
View test_faraday_timeout.rb
require 'faraday'
conn = Faraday.new(url: 'http://localhost:3000') do |faraday|
faraday.request :url_encoded
faraday.response :logger
faraday.adapter Faraday.default_adapter
faraday.request :multipart
end
conn.post do |req|
@jkeck
jkeck / svg-pie-chart.css
Created Nov 14, 2015
Simple SVG Pie Chart
View svg-pie-chart.css
svg {
width: 100px;
border-radius: 50%;
background:yellowgreen;
transform: rotate(-90deg);
}
circle {
fill: none;
stroke-width: 32;
@jkeck
jkeck / form.html
Last active Aug 29, 2015
SearchWorks Search Form
View form.html
<!-- Example: http://stanford.edu/~jkeck/sw-search.html -->
<form action="http://searchworks.stanford.edu/" method="get">
<label for="q">SearchWorks</label>
<input type="text" name="q" id="q" />
<input type="submit" value="Search" />
</form>
@jkeck
jkeck / app.rb
Created Apr 17, 2015
Example configuration
View app.rb
config.libraries = {
'ARS' => 'Archive of Recorded Sound',
'ART' => 'Art & Architecture Library',
'BIOLOGY' => 'Biology Library (Falconer)',
'BUSINESS' => 'Business Library',
'CHEMCHMENG' => 'Chemistry & ChemEng Library (Swain)',
'CLASSICS' => 'Classics Library',
'EARTH-SCI' => 'Earth Sciences Library (Branner)',
'EAST-ASIA' => 'East Asia Library',
'EDUCATION' => 'Education Library (Cubberley)',
@jkeck
jkeck / blacklight-customization.md
Last active Aug 29, 2015
Outline for Blacklight Customization Workshop at HydraConnect.
View blacklight-customization.md

Basic Configuration

  • i18n (a lot of view overrides could be accomplished with i18n overrides)
  • blacklight_config (Controller Configuration)
    • Facets
    • Fields
    • Sorts
    • Search fields (search type drop-down)
    • Thumbnail by field

Advanced Configuration

View gist:b63922dc5a66fa368eba
(function($) {
/*
jQuery plugin to render Google book covers for image elements
Usage: $(selector).renderGoogleBookCovers();
This plugin :
- collects all 'img.cover-image' elements and batches them
- using ISBN, OCLC & LCCN value(s) of image elements inside each batch,
Google cover images are added using Google Books API
View export.rb
def initialize(controller, response_docs)
@controller = controller
@response_docs = response_docs
end
def blacklight_maps_config
@controller.blacklight_config.view.maps
end
def type
View gist:9334756
configure_blacklight do |config|
config.default_solr_params = {
:qt => 'search',
:qf => 'id content url title anchor author',
:rows => 10,
:"hl.fl" => "content",
:"hl.simple.pre" => '<span class="label label-info">',
:"hl.simple.post" => "</span>",
:hl => true
}
You can’t perform that action at this time.