Skip to content

Instantly share code, notes, and snippets.

@TimidRobot
TimidRobot / publish.py.diff
Last active August 17, 2023 13:55
rdf_gen legal_tools/management/commands/publish.py diff
--- legal_tools/management/commands/publish.py 2023-08-17 06:52:38
+++ legal_tools/management/commands/publish.py.NEW 2023-08-17 06:52:29
@@ -110,6 +110,17 @@
return legal_code.get_redirect_pairs()
+def save_rdf(output_dir, tool):
+ # Function is at top level of module so that it can be pickled by
+ # multiprocessing.
+ relpath = os.path.join(tool._get_save_path(), "rdf")
@TimidRobot
TimidRobot / ccorg_index_migration.diff
Last active August 23, 2023 17:30
ccorg_index_migration.diff
diff --git pillars/3_HST/index/init.sls pillars/3_HST/index/init.sls
index f99434f..a38d64e 100644
--- pillars/3_HST/index/init.sls
+++ pillars/3_HST/index/init.sls
@@ -27,5 +27,6 @@ states:
wordpress.apache2: {{ sls }}
wordpress.index: {{ sls }}
wordpress:
+ docroot: /var/www/index
multisite: False
@TimidRobot
TimidRobot / block_example.rdf
Created August 24, 2023 16:38
excerpt from index.rdf
<dcterms:isReplacedBy>
<cc:License rdf:about="http://creativecommons.org/licenses/by-nc-nd/4.0/">
<cc:legalcode rdf:resource="http://creativecommons.org/licenses/by-nc-nd/4.0/legalcode.ar"/>
<cc:legalcode rdf:resource="http://creativecommons.org/licenses/by-nc-nd/4.0/legalcode.cs"/>
<cc:legalcode rdf:resource="http://creativecommons.org/licenses/by-nc-nd/4.0/legalcode.da"/>
<cc:legalcode rdf:resource="http://creativecommons.org/licenses/by-nc-nd/4.0/legalcode.de"/>
<cc:legalcode rdf:resource="http://creativecommons.org/licenses/by-nc-nd/4.0/legalcode.el"/>
<cc:legalcode rdf:resource="http://creativecommons.org/licenses/by-nc-nd/4.0/legalcode.en"/>
<cc:legalcode rdf:resource="http://creativecommons.org/licenses/by-nc-nd/4.0/legalcode.es"/>
<cc:legalcode rdf:resource="http://creativecommons.org/licenses/by-nc-nd/4.0/legalcode.eu"/>
@TimidRobot
TimidRobot / dup.sh
Last active June 26, 2024 20:27
macOS helper script to start services defined by docker compose and clean them up after they are stopped
#!/bin/bash
#
# Helper script to start services defined by docker compose and clean them up
# after they are stopped
# - launches docker if it is not currently running
# - requires macOS and Docker Desktop
#
set -o errexit
set -o errtrace
set -o nounset
@TimidRobot
TimidRobot / update_repos.sh
Created April 23, 2025 08:56
Assuming a directory of repositories, ensure they are all up-to-date
#!/usr/bin/env bash
#
# Assuming a directory of repositories, ensure they are all up-to-date if:
# 1. HEAD is one of: gh-pages, master, or main
# 2. there are no local modifications
#
# For example:
# cd git
# ./update_repos.sh creativecommons
#
@TimidRobot
TimidRobot / smithsonian_2_units.csv
Created February 3, 2026 17:50
smithsonian_2_units.csv fetched 2026 Jan 29
UNIT CC0_RECORDS CC0_RECORDS_WITH_CC0_MEDIA TOTAL_OBJECTS
AAA 0 0 29785
AAG 0 0 351
ACM 251 247 2977
ACMA 0 0 57
CFCHFOLKLIFE 17544 0 18518
CHNDM 58174 54606 201567
FBR 1517 37 11248
FSG 4719 4719 45568
HAC 430 430 1437
@TimidRobot
TimidRobot / arxiv_fetch.log
Last active February 6, 2026 06:38
arxiv_fetch.py log output with `time` annotation; 3,746 lines
2026-02-05 20:24:46,998 - INFO - arxiv_fetch - Parsing command-line options
2026-02-05 20:24:46,999 - INFO - shared - PATHS:
repo: /Users/timidrobot/git/creativecommons/quantifying
data: ./data
data_1-fetch: ./data/2026Q1/1-fetch
data_2-process: ./data/2026Q1/2-process
data_3-report: ./data/2026Q1/3-report
data_phase: ./data/2026Q1/1-fetch
data_quarter: ./data/2026Q1
2026-02-05 20:24:47,000 - INFO - arxiv_fetch - Loading CC Legal Tool metadata for CC identifer mapping