Skip to content

Instantly share code, notes, and snippets.

Graham Hukill ghukill

Block or report user

Report or block ghukill

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
@ghukill
ghukill / loadenv
Created Aug 7, 2019
Load envars from a key=value file
View loadenv
echo "loading env vars from: $1"
export $(grep -v '^#' $1 | xargs)
echo "all done!"
View gist:59c465dbd8347ba250d409786b8e4ccb
# pairtree example
├── 0=ocfl_1.0
├── 1=my_uuid_quad_tree_spec
├── 6ba7
└── b810
└── 9dad
└── 11d1
└── 80b4
└── 00c0
└── 4fd4
@ghukill
ghukill / sibling_distribution.py
Created Nov 25, 2018
sibling hash field distribution
View sibling_distribution.py
sibling_field_dist = {'mods|mods(6adf01)___mods|abstract(97c301)': 150,
'mods|mods(6adf01)___mods|accessCondition(97c301)___@type=use and reproduction': 655,
'mods|mods(6adf01)___mods|language(97c301)___mods|languageTerm(548f01)___@type=code': 655,
'mods|mods(6adf01)___mods|location(97c301)___mods|url(6adf02)___@usage=primary': 26,
'mods|mods(6adf01)___mods|location(97c301)___mods|url(6adf03)___@access=preview': 26,
'mods|mods(6adf01)___mods|location(97c301)___mods|url(6adf04)___@usage=primary': 91,
'mods|mods(6adf01)___mods|location(97c301)___mods|url(6adf05)___@access=preview': 91,
'mods|mods(6adf01)___mods|location(97c301)___mods|url(6adf05)___@usage=primary': 78,
'mods|mods(6adf01)___mods|location(97c301)___mods|url(6adf06)___@access=preview': 78,
'mods|mods(6adf01)___mods|location(97c301)___mods|url(6adf06)___@usage=primary': 61,
@ghukill
ghukill / Vagrantfile
Last active Aug 31, 2018
Ubuntu 18.04 Vagrantfile
View Vagrantfile
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.hostname = "myamazingmachine"
config.vm.box = "bento/ubuntu-18.04"
config.vm.provider "virtualbox" do |vb|
@ghukill
ghukill / gist:6f2ae673c0b02ef9d2a136cb22a9d800
Last active Apr 11, 2018
markdown to reStructuredText (RST) regex
View gist:6f2ae673c0b02ef9d2a136cb22a9d800
\[(.+?)\]\((.+?)\)
`\1 <\2>`_
View test.py
def funFunction():
print('hey!')
View combine_django_db_boostrap.json
[
{
"model": "core.oaiendpoint",
"pk": 1,
"fields": {
"name": "Wayne Ouroboros",
"endpoint": "http://digital.library.wayne.edu/api/oai",
"verb": "ListRecords",
"metadataPrefix": "mods",
"scope_type": "setList",
@ghukill
ghukill / any_content.rng
Created Feb 5, 2018
Recursive allow hack for RELAX NG
View any_content.rng
<?xml version="1.0" encoding="UTF-8"?>
<grammar
xmlns="http://relaxng.org/ns/structure/1.0"
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<choice>
<ref name="any_content"/>
</choice>
</start>
@ghukill
ghukill / combine_bootstrap.sql
Created Jan 23, 2018
MySQL bootstrap for Combine
View combine_bootstrap.sql
-- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64)
--
-- Host: localhost Database: combine
-- ------------------------------------------------------
-- Server version 5.7.20-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@ghukill
ghukill / pyvs.py
Created Dec 19, 2017
Example python record validation functions for Combine
View pyvs.py
'''
You can import most any python library that you'd like up here, and then use within checking functions
'''
import re
'''
Each function is its own "test" when validating against a record.
You can’t perform that action at this time.