Skip to content

Instantly share code, notes, and snippets.

View erochest's full-sized avatar

Eric Rochester erochest

View GitHub Profile
<address class="vcard" vocab="http://www.w3.org/2006/vcard/ns#" resource="http://scholarslab.org/" typeof="Organization">
<span class="org fn">
<a class="url organization-name" href="http://scholarslab.org/">
<span property="formattedName">Scholars’ Lab</span>
</a>
<a class="organization-unit extended-address" href="http://lib.virginia.edu/" property="hasOrganizationName" resource="http://lib.virginia.edu/" typeof="Organization">
<span property="formattedName">University of Virginia Library</span>
</a>
</span>
<span property="hasAddress" typeof="Work">
(function(window, $, undefined) {
var $window = $(window);
/**
* Show or hide the button depending on the scroll position.
*/
function animateButton() {
var button = $('#back-to-top');
var scrollPosition = $window.scrollTop();
if (scrollPosition > 400) {
-- Geonetwork migration
CREATE TABLE CustomElementSet
(
xpath varchar(1000) not null
);
-- Fix languages table
ALTER TABLE Languages
ADD COLUMN isocode varchar(3),
@erochest
erochest / add_item_snippet.rb
Created September 26, 2012 18:18 — forked from waynegraham/add_item_snippet.rb
Geocoding in Omeka
add_item_page.form_with(:method => 'POST') do |item_form|
item_form['public'] = 1
item_form['Elements[50][0][text]'] = line[:address]
# This should really be KML, but it will recognize WKT too.
item_form['Elements[38][0][geo]'] = line[:point]
item_form['Elements[38][0][zoom]'] = 10
item_form['Elements[38][0][mapon]'] = 1
item_form['Elements[38][0][center_lon]'] = line[:lon]
item_form['Elements[38][0][center_lat]'] = line[:lat]
@erochest
erochest / multiple_creators.php
Created July 31, 2012 18:15 — forked from jeremyboggs/multiple_creators.php
Changes how creators are listed depending on their numbers
<?php
/**
* One Creator: "Jane Doe"
* Two creators: "Jane Doe and John Doe"
* Three creators: "Jane Doe, John Doe, and Jim Doe"
* Four or more: "Jane Doe et al."
*/
if ($creators) {
switch (count($creators) {
@erochest
erochest / multiple_creators.php
Created July 31, 2012 18:15 — forked from jeremyboggs/multiple_creators.php
Changes how creators are listed depending on their numbers
<?php
/**
* One Creator: "Jane Doe"
* Two creators: "Jane Doe and John Doe"
* Three creators: "Jane Doe, John Doe, and Jim Doe"
* Four or more: "Jane Doe et al."
*/
if ($creators) {
@erochest
erochest / reset-solr
Created April 12, 2012 15:11 — forked from waynegraham/gist:2355797
Delete solr index with curl
curl http://localhost:8983/solr/update?commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'
#! /usr/bin/env bash
# install local janus config
curl -L https://gist.github.com/raw/1166018/bfba67168e2f2b74fa7d7debf9ed13ca798429f1/.janus.rake > ~/.janus.rake
# install janus plugins for vim
curl https://raw.github.com/carlhuda/janus/master/bootstrap.sh -o - | sh
# install rvm
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)