Skip to content

Instantly share code, notes, and snippets.

View ewlarson's full-sized avatar

Eric Larson ewlarson

View GitHub Profile
1/3 cup olive oil
1/3 cup balsamic vinegar
1/3 cup mayo
1t sugar
1t dijon mustard
1t Country French Vinaigrette dressing mix (Penzey's spices)
1 garlic clove
Everything into the food processor. Whirl. Enjoy.
Library Name,URL,PageSpeed Score
University of Minnesota Libraries , https://www.lib.umn.edu/ ,97
National Agricultural Library , http://www.nal.usda.gov/ ,90
Princeton University Library , http://library.princeton.edu/ ,89
University of Manitoba Libraries , http://www.umanitoba.ca/libraries/ ,87
University of Toronto Libraries , http://onesearch.library.utoronto.ca/ ,87
Massachusetts Institute of Technology Libraries , http://libraries.mit.edu/ ,85
Yale University Library , http://www.library.yale.edu/ ,85
University of New Mexico Library , http://www.unm.edu/libraries/ ,83
University of Pennsylvania Libraries , http://www.library.upenn.edu/ ,83
@ewlarson
ewlarson / example.rb
Created February 22, 2017 20:55
Using the google-api-ruby-client gem, here is an example for fetching Google Analytics Reporting API V4 data.
require 'google/apis/analyticsreporting_v4'
analytics = Google::Apis::AnalyticsreportingV4::AnalyticsReportingService.new
# Authentication / Authorization
# via credentials.json
#
# File downloaded via Google's API Manager
# - Create a Service Account
# - Add the service account's email address to your Google Analytics account
@ewlarson
ewlarson / centroids.rb
Last active August 31, 2017 05:49
Calculate centroid for Solr RPT field value
# Install Dependences
require 'rsolr'
# Connect to solr
solr = RSolr.connect :url => 'http://localhost:8983/solr/geoportal'
# Search request
response = solr.get 'select', :params => {:q => '*:*', :rows => '10000'}
@ewlarson
ewlarson / cdm_iiif_manifest.rb
Last active July 31, 2019 21:17
UMedia Item to IIIF Manifest
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'json'
gem 'iiif-presentation'
end
require 'open-uri'
require 'iiif/presentation'
@ewlarson
ewlarson / google_sheets.rb
Last active June 27, 2019 20:09
UMedia CSV to IIIF manifest
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'json'
gem 'iiif-presentation'
end
require 'csv'
require 'open-uri'
@ewlarson
ewlarson / gimlet_list_entries.rb
Last active November 7, 2019 15:35
Gimlet API - Example GET request to list entries
# Ruby Example
require 'date'
require 'faraday'
require 'json'
# Required API Variables
domain = 'your_domain'
email = 'your_email_address'
api_key = 'your_api_key'
site_id = 'your_site_id'
@ewlarson
ewlarson / example.rb
Last active January 4, 2023 21:47
Gimlet - API - All Questions call with start_date and end_date
require 'date'
require 'faraday' # Faraday v2
require 'json'
#
# List all Questions from an account via start_date and end_date params as JSON
#
# Required API Variables
DOMAIN = 'foo' # Without .gimlet.us