Skip to content

Instantly share code, notes, and snippets.

Ducking and diving

Daniel Pett portableant

Ducking and diving
View GitHub Profile
View gist:a57a7699300e3add60b31d18698e4157
<div class="col-12 shadow-sm p-3 mx-auto mb-3 ">
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" title="A YouTube video from the Fitzwilliam Museum"
src="{{page.video_id}}" frameborder="0"
View subs.txt
متحف فيتزويليام، كامبريدج
بورتريهات مومياوات العصر الروماني
تقنيات الرسم والتلوين
انا د.لوسي رابسون
متخصصة في ترميم اللوحات بمعهد
portableant / fitz.json
Created May 19, 2021
Fitzwilliam Museum boundary
View fitz.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
portableant / code.js
Created May 18, 2021
Google action script for parsing sheets data to docs template replacements
View code.js
function createDocument() {
// Get the headers from a sheet with the sheet id number
var headers = Sheets.Spreadsheets.Values.get('1-3du2O3thRu4Ynj_6ShC0tajxjXOiAufA68Uq_z_F6M', 'A1:AU1');
// Define the area from which to pull data. Assume 200 rows
var starters = Sheets.Spreadsheets.Values.get('1-3du2O3thRu4Ynj_6ShC0tajxjXOiAufA68Uq_z_F6M', 'A2:AU200');
// Define your google document template id number
var templateId = '1tSMgb6m7IfbhSdAeGx2tqYS5fDG5uRyFBVEfmhPUDDA';
for(var i = 0; i < starters.values.length; i++){
portableant /
Created Apr 12, 2021
Jekyll bundle fail - OSX Big Sur Ruby 3.0.0


bundle exec jekyll serve Configuration file: /Users/danielpett/Documents/githubProjects/steppe-gold/_config.yml Source: /Users/danielpett/Documents/githubProjects/steppe-gold Destination: /Users/danielpett/Documents/githubProjects/steppe-gold/_site Incremental build: disabled. Enable with --incremental Generating... Jekyll Feed: Generating feed for posts done in 0.462 seconds.

portableant /
Last active Feb 13, 2021
Hacky script for splitting pdf to pages
## Split pdf files into pages and ocr text (this is a bit honky, but works as a demo)
## Daniel Pett 11/2/2021
__author__ = 'portableant'
## Tested on Python 2.7.16
## Usage example
## python3 -p . -f 1975_1989.pdf -d processed -n 1975_1989_processed -o ocr
## mac osx brew install poplar and echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.zshrc
import argparse
View gist:2d67f707e7997271acc42857f0c6044d
<div class="card col-sm p-0 m-2">
<div class="embed-responsive embed-responsive-16by9">
<iframe src="{{ }}" frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen class="embed-responsive-item"></iframe>
portableant / howtouse.txt
Created Oct 12, 2020
Lenborough hoard stitch images together
View howtouse.txt
Install the PIL library on windows at the powershell prompt by typing the command below
pip3 install PIL
1. Now save your images into a folder on your computer and make a note of the path (don't work on your master images, use a copied folder)
2. Save the file from here in the same directory
3. Remove all the images with the scale bar included as you don't need these
4. Now edit the file and replace line 14 with the path to the directory where you have your lenborough images
5. Now go back to powershell and type:
## Split audio files into chunks
## Daniel Pett 1/5/2020
__author__ = 'portableant'
## Tested on Python 2.7.16 - yes I know I need to upgrade.
import argparse
import os
import speech_recognition as sr
import csv
portableant / transcribedAudio.csv
Created May 11, 2020
A raw csv of transcribed data
View transcribedAudio.csv
We can't make this file beautiful and searchable because it's too large.
91146,"","yes","",1,"Daniel Pett; Jeff Okazaki",""
91146,"Domenico Ghirlandaio ran one of the biggest and most successful artist workshops in Florence towards the end of the Fifteenth century and it used to be thought that this","no","",,"Daniel Pett; Jeff Okazaki",""
91146,"Domenico Ghirlandaio ran one of the biggest and most successful artist workshops in Florence towards the end of the Fifteenth Century and it used to be thought that this...","no","",243,"Daniel Pett; Jeff Okazaki",""
91147,"nativity scene was produced by a junior member under his supervision but cleaning in the 1990s revealed just how good some of the painting here is","yes","",243,"Daniel Pett; J