Skip to content

Instantly share code, notes, and snippets.

View jeremyboggs's full-sized avatar

Jeremy Boggs jeremyboggs

  • Scholars' Lab, UVa Library
  • Charlottesville, Virginia
View GitHub Profile
@jeremyboggs
jeremyboggs / jsonl-to-csv.py
Created March 13, 2024 18:32
Converts JSONL generated from Browsertrix to CSV.
import json
import csv
# Identify the JSONL fields we wish to retrieve and write
# to the CSV file.
fields = ['id','title','text','url']
# Open a new CSV file and open the existing JSONL file.
with open('pages.csv', 'w') as csv_file, open("pages.jsonl", "r") as json_file:
# Create a CSV writer object.
@jeremyboggs
jeremyboggs / prosody.html
Created January 8, 2024 19:43
prosody.html
<?xml version="1.0"?>
<div xmlns="http://www.w3.org/1999/xhtml" id="rhyme" style="display:none;"><div id="rhymespacer"> </div><form name="abbaabbacdcdcd" id="rhymeform" autocomplete="off"><p><br/></p><div class="lrhyme"><input size="1" maxlength="1" value="" name="lrhyme-1-1" type="text" onFocus="this.value='';this.style['color'] = '#44FFFF';"/></div><div class="lrhyme"><input size="1" maxlength="1" value="" name="lrhyme-1-2" type="text" onFocus="this.value='';this.style['color'] = '#44FFFF';"/></div><div class="lrhyme"><input size="1" maxlength="1" value="" name="lrhyme-1-3" type="text" onFocus="this.value='';this.style['color'] = '#44FFFF';"/></div><div class="lrhyme"><input size="1" maxlength="1" value="" name="lrhyme-1-4" type="text" onFocus="this.value='';this.style['color'] = '#44FFFF';"/></div><div class="lrhyme"><input size="1" maxlength="1" value="" name="lrhyme-1-5" type="text" onFocus="this.value='';this.style['color'] = '#44FFFF';"/></div><div class="lrhyme"><input size="1" maxlength="1" value=""
@jeremyboggs
jeremyboggs / soup.py
Created January 8, 2024 18:32
First few lines to get some web text for Beautiful Soup.
import requests
from bs4 import BeautifulSoup
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:121.0) Gecko/20100101 Firefox/121.0'}
page_url = 'https://example.com'
page_text = requests.get(page_url,headers=headers).text
soup = BeautifulSoup(feed_text);
print(soup);
@jeremyboggs
jeremyboggs / dh-portfolio.md
Created February 22, 2023 21:17
Notes and Resources for DH Portfolio Workshop
@jeremyboggs
jeremyboggs / zotero.md
Created November 10, 2022 20:01
Zotero things

Jekyll

  • Pandemic Academy (Github) was a modest attempt to create a website from a group bibliography, in collaboration with Alison.
  • Jekyll Scholar, a gem that provides tools for mixing blogging and scholarly activity (e.g. citation, bibliography)
  • jekyll-ld, a gem for parsing various Linked Data attributed in a Jekyll site.
  • rzotero, early (and not up-to-date) Ruby wrapper for the Zotero API.

Python

@jeremyboggs
jeremyboggs / checklist.md
Created October 3, 2022 14:47
Checklist for removing a project

Removing a project from our hosting

Checklist

  • Remove DNS entry
  • Remove nginx configuration; turn off Github Pages; Remove Traefik
  • docker-compose down
  • Delete container from websites directory

Questions and considerations

  • Protocol for archiving it.
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@200;300&display=swap" rel="stylesheet">
<style>
html,body {
margin:0;
padding:0;
}
<main role="main" id="main">
<article>
<header>
<h1>Typography Test</h1>
</header>
<div class="content">
<h2>Aliud igitur esse censet gaudere, aliud non dolere.</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. <a href="http://loripsum.net/" target="_blank">Apparet statim, quae sint officia, quae actiones.</a> Licet hic rursus ea commemores, quae optimis verbis ab Epicuro de laude amicitiae dicta sunt. <b>Quis Aristidem non mortuum diligit?</b> Ergo hoc quidem apparet, nos ad agendum esse natos. Duo Reges: constructio interrete. Nunc dicam de voluptate, nihil scilicet novi, ea tamen, quae te ipsum probaturum esse confidam. <i>Quo igitur, inquit, modo?</i> Quis est tam dissimile homini. Tenesne igitur, inquam, Hieronymus Rhodius quid dicat esse summum bonum, quo putet omnia referri oportere? <a href="http://loripsum.net/" target="_blank">Que Manilium, ab iisque M.</a> <a href="http://loripsum.net/" target="_blank">Sed plane dicit quod intellegit.</a> </p>