Skip to content

Instantly share code, notes, and snippets.

View bess's full-sized avatar

Bess Sadler bess

View GitHub Profile
@bess
bess / manifest.json
Created October 30, 2019 17:26
iiif manifest
// 20191030121700
// https://tenejo-dev.curationexperts.com/concern/works/44558d306/manifest
{
"@context": "http://iiif.io/api/presentation/2/context.json",
"@type": "sc:Manifest",
"@id": "https://tenejo-dev.curationexperts.com/concern/works/44558d306/manifest",
"label": "My favorite animal",
"metadata": [
{
# /home/bess/.tmuxinator/dlpcurate.yml
name: dlpcurate
root: ~/projects/dlp-curate
pre_window: rvm use 2.5.3@dlp-curate
#on_project_start: sudo /etc/init.d/postgresql start && sudo /etc/init.d/redis-server start
#on_project_stop: sudo /etc/init.d/postgresql stop && sudo /etc/init.d/redis-server stop

DCE Standard Toolset

  • SSH Key Management & key pair
  • GitHub account - with key pair
  • Recent OSX distribution (High Sierra)
  • Xcode
  • Xcode command line tools (xcode-select --install)
  • Bluejeans
  • Editor (Textmate / Rubymine / Atom)
  • Homebrew
  • Slack
- hosts: 'uw'
name: ensure python is installed for ansible
user: ubuntu
gather_facts: false
pre_tasks:
- name: update apt cache
become: yes
package: update_cache=yes
- name: upgrade apt packages
{
"@context": "http://iiif.io/api/presentation/2/context.json",
"@type": "sc:Manifest",
"@id": "http://localhost:3000/manifest.json",
"label": "al-Bayān wa-al-iʻrāb ʻammā bi-arḍ Miṣr min al-Aʻrāb / Aḥmad ibn ʻAlī al-Maqrīzī",
"description": "Treatise on the Arab tribes which settled in Egypt.",
"metadata": [
{
"label": "Creator",
"value": "Maqrīzī, Aḥmad ibn ʻAlī, 1364-1442"
@bess
bess / rails_42_with_active_support.rb
Created March 11, 2020 12:14 — forked from tonytonyjan/rails_42_with_active_support.rb
session cookie decrypter for Rails
require 'cgi'
require 'json'
require 'active_support'
def verify_and_decrypt_session_cookie(cookie, secret_key_base)
cookie = CGI::unescape(cookie)
salt = 'encrypted cookie'
signed_salt = 'signed encrypted cookie'
key_generator = ActiveSupport::KeyGenerator.new(secret_key_base, iterations: 1000)
secret = key_generator.generate_key(salt)
require 'logger'
require 'cgi'
##
# Sample Ruby delegate script containing stubs and documentation for all
# available delegate methods. See the user manual for more information.
#
# The application will create an instance of this class early in the request
# cycle and dispose of it at the end of the request cycle. Instances don't need
# to be thread-safe, but sharing information across instances (requests)
# **does** need to be done thread-safely.
@bess
bess / visibility_bug_hunt.md
Last active October 23, 2020 22:00
Going on a bug hunt

Bug Hunting in Hyrax

I recently had to find a bug in a Hyrax application, and I thought it might be helpful if I documented the process.

1. Define the problem

I like to start a bug hunt with a clear description of what exactly I’m trying to solve. A great place to do this is in a ticket on the team’s board. In this case, the problem was that when new works were submitted to Hyrax via the create work form, the visibility was not being persisted. I find it helpful to write out the bug definition as a user story:

As a content contributor, when I submit a new work through the form, I want to be able to make it public so that it will be visible to the world. Instead, the work always ends up being marked as restricted / private. 
@bess
bess / blacklight_advanced_search_in_hyku.md
Last active November 4, 2020 21:28
blacklight_advanced_search_in_hyku.md

Adding blacklight_advanced_search to Hyku

I was recently asked to add Blacklight Advanced Search to a Hyku app for the US Department of Transportation. It was a little tricky, so I’m documenting the process in the hopes of making life easier for the next person who has to do this.

Many thanks to Dean Farrell at UNC Libraries for pointing me at UNC’s hy-c implementation, where blacklight advanced search is installed into Hyrax: https://github.com/UNC-Libraries/hy-c/pull/421/files

David Kinzer’s Blacklight Search Notes are also excellent background reading: https://gist.github.com/dkinzer/4f6dbb4634dbbdc99255dbea6305ccae

Write a feature spec first

Keybase proof

I hereby claim:

  • I am bess on github.
  • I am eosadler (https://keybase.io/eosadler) on keybase.
  • I have a public key ASDTGkEztXBuqdHklXp2ErAQRT9FxfQkZKZSArN0f3VE3go

To claim this, I am signing this object: