Skip to content

Instantly share code, notes, and snippets.

View triplingual's full-sized avatar

Trip Kirkpatrick triplingual

  • Yale University Library
  • New Haven, CT
View GitHub Profile
@triplingual
triplingual / wget-single-omeka-classic-exhibit.txt
Created September 16, 2019 20:22
wget a single Omeka Classic exhibit not hosted on Omeka.net
# Caveats
# I'm no shell expert
# This is in Bash on a Mac running Mojave
# You may need to read the whole thing before using
#
# Explanation
# (hopefully intelligible to the advanced beginner or low intermediate Bash user)
#
# * Slashes at the line ends tell the shell to consider the next line part of the command
#
@triplingual
triplingual / jstor-dfr-wordcount-xform.py
Created January 22, 2019 21:35
Python script to transform wordcount files needed for @agoldst/dfrtopics (older) from JSTOR DFR ngram XML files (newer)
# columns to create and populate:
# WORDCOUNTS, WEIGHT
import unicodecsv as csv # need to install unicodecsv, tho
import re
import os
import sys
import glob
if len(sys.argv) < 2:
@triplingual
triplingual / jstor-dfr-metadata-parser.py
Created January 8, 2019 15:37
Python script to get data needed for @agoldst/dfrtopics (older) from JSTOR DFR metadata XML files (newer)
# columns to create and populate:
# id, doi, title, author, journaltitle, volume, issue, pubdate,
# pagerange, publisher, type, reviewed-work, abstract
import xml.etree.ElementTree
import unicodecsv as csv # need to install unicodecsv, tho
import re
import os
import sys
import glob
@triplingual
triplingual / itcToImageV2.1.sh
Last active February 14, 2024 03:18
Script to transform Apple iTunes' .itc files into images (JPG or PNG)
#!/bin/bash
# Script to transform Apple iTunes' .itc files into images (JPG or PNG)
#
# This is a mod of the very useful script by Matthieu Riegler (@kyro38) at
# https://github.com/kyro38/MiscStuff/blob/master/Useless/itc/itcToImageV2.sh
#
# The mods are
# * to use `find` rather than `gfind` (I'm on a Mac and find` works just fine
# and I don't need to install `coreutils` just for this task)
# * to parameterize the source and destination directories for the .itc files
@triplingual
triplingual / qatar.geojson
Created October 1, 2017 21:20
Qatar outline from Mapzen Spelunker
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@triplingual
triplingual / gephi-sigma-main-hack00.js
Created May 16, 2016 17:40
Hacks to main.js nodeActive function in Oxford Internet Institute sigma.js plugin for Gephi to get edge properties
function nodeActive(a) {
var groupByDirection=false;
if (config.informationPanel.groupByEdgeDirection && config.informationPanel.groupByEdgeDirection==true) groupByDirection=true;
sigInst.neighbors = {};
sigInst.detail = !0;
var b = sigInst._core.graph.nodesIndex[a];
/* ~~~~ HACK PART 1 START ~~~ */
@triplingual
triplingual / gephi-sigma-edge-props.json
Created May 16, 2016 17:21
Commented text showing how to hack a label size change.
{
"sigma": {
"drawingProperties": {
"activeFontStyle": "bold",
"defaultEdgeType": "curve",
"defaultHoverLabelBGColor": "#002147",
"defaultLabelColor": "#000",
"defaultLabelHoverColor": "#fff",
"defaultLabelSizeComment": "Changing 'defaultLabelSize' doesn't change the default label size if 'fontStyle' is at its default, 'bold'. Stripping that value allows for adjustments.",
"defaultLabelSize": 16,
@triplingual
triplingual / berg-places.geojson
Last active May 7, 2017 16:24
Figuring out how to do some mapping of locatable places in "Warsaw Ghetto, a Diary by Mary Berg"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.