Skip to content

Instantly share code, notes, and snippets.

Avatar

Eric Rochester erochest

View GitHub Profile
View slab-hcard.html
<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">
View back-to-top.js
(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) {
View geonetwork-db-postgis-migration.sql
-- Geonetwork migration
CREATE TABLE CustomElementSet
(
xpath varchar(1000) not null
);
-- Fix languages table
ALTER TABLE Languages
ADD COLUMN isocode varchar(3),
View add_item_snippet.rb
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 Jul 31, 2012 — forked from jeremyboggs/multiple_creators.php
Changes how creators are listed depending on their numbers
View multiple_creators.php
<?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 Jul 31, 2012 — forked from jeremyboggs/multiple_creators.php
Changes how creators are listed depending on their numbers
View multiple_creators.php
<?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 Apr 12, 2012 — forked from waynegraham/gist:2355797
Delete solr index with curl
View reset-solr
curl http://localhost:8983/solr/update?commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'
View os_x_dev_setup.sh
#! /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)