Skip to content

Instantly share code, notes, and snippets.

@mcampos-quinn
mcampos-quinn / marcJSON.json
Created May 16, 2019 20:15
JSON parsed from csv to MARC-like structure
[{
"leader": "00000nim a2200000m 4500",
"fields": [{
"001": ""
}, {
"005": ""
}, {
"008": "20190516s cau nn o lt n eng d"
}, {
"007": {
@mcampos-quinn
mcampos-quinn / tvtv-ead-stuff.py
Created March 13, 2019 00:37
lxml for modifying ead
'''
Archivesspace and OAC will expect a digital object to be enclosed in a <dao> tag as follows,
under the <did> for a <c> tag at the appropriate level (e.g., file or item).
<dao xlink:actuate="onRequest" xlink:href="http://test.test" xlink:show="new" xlink:title="test digital object">
<daodesc>
<p>test digital object</p>
</daodesc>
</dao>
@mcampos-quinn
mcampos-quinn / openrefine_scratchpad.txt
Last active May 12, 2020 00:07
recipes and stuff for openrefine, grel expressions
################
Transform cells containing a single name in `Fn Mn Ln` format into `Ln, Fn Mn`
value.split(/ (?=[^ ]*$)/).reverse().join(", ")
the split regex catches the last " " space that occurs and takes the characters after it as the last name,
then moves it to the front and joins the values with comma-space.
To perform this transformation, at the top of a column, go to Edit Cells> Transform and paste the expression into the box.
####################
$ ffmpeg -i extraordinary-adventures-of-mr-west_03965_PM0010199_R01of04.mov -movflags faststart -threads 1 -vf pad='width=ceil(iw/2)*2:height=ceil(ih/2)*2' -pix_fmt yuv420p -c:v libx264 -f mp4 -crf 18 -maxrate 12000k -c:a aac -ac 2 -b:a 320k -ar 48000 out.mp4
ffmpeg version 4.1-1~16.04.york0 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.11) 20160609
configuration: --prefix=/usr --extra-version='1~16.04.york0' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable
@mcampos-quinn
mcampos-quinn / mediainfo_dpx_wav_directory.txt
Created December 11, 2018 22:46
mediainfo output for DPX+WAV film scan
# output of running `mediainfo` (Ubuntu, MediaInfoLib - v18.08.20180908) on a folder
# with a dpx subfolder and a sidecar wav file. All the files have the same
# prefix "academy-leader_16940_BARCODE_R01of02" and the DPX sequence is numbered
# in sequence. :)
General
Complete name : academy-leader_16940_BARCODE_R01of02/
Format : Directory
File size : 4.57 GiB
Duration : 7 s 958 ms
@mcampos-quinn
mcampos-quinn / scratchpad.sh
Last active April 4, 2019 23:29
scratchpad
# SSH TUNNEL ~ BROWSER REDIRECT WITH SOCKS PROXY
ssh -D 8080 -C -N user@1.2.3.4
# FROM `man ssh`:
# -D [bind_address:]port
# Specifies a local ``dynamic'' application-level port forwarding.
# This works by allocating a socket to listen to port on the local
# side, optionally bound to the specified bind_address. Whenever a
# connection is made to this port, the connection is forwarded over
# the secure channel, and the application protocol is then used t
@mcampos-quinn
mcampos-quinn / openrefine_jython_merge_columns.py
Last active May 14, 2019 22:34
OpenRefine Jython / Python expression to conditionally merge columns
'''
This jython expression merges columns that are named sequentially,
but only if there is data in the column.
Trying to merge columns with GREL that include empty cells results in an error.
My data included columns like this:
Title 1 | Title 2 .. | .. Title 14
----
My Title | Other Title | etc.
@mcampos-quinn
mcampos-quinn / # gtk+3 - 2018-04-12_16-24-17.txt
Created April 12, 2018 23:35
gtk+3 on Ubuntu 16.04.4 LTS - Homebrew build logs
Homebrew build logs for gtk+3 on Ubuntu 16.04.4 LTS
Build date: 2018-04-12 16:24:17