Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / 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 / 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 / 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 / rdf_generator.py.diff
Created August 10, 2023 16:27
diff --git legal_tools/rdf_generator.py legal_tools/rdf_generator.py
index 97005a4..23ddca6 100644
--- legal_tools/rdf_generator.py
+++ legal_tools/rdf_generator.py
@@ -129,6 +129,7 @@ def generate_rdf_file(
# )
if tool_obj.jurisdiction_code:
+ logo_prefix = f"{foaf_logo_url}{tool_obj.unit}/{tool_obj.version}/{tool_obj.jurisdiction_code}"
g.add(
(
@TimidRobot
TimidRobot / index.rdf
Created August 10, 2023 16:04
http http://localhost:8005/rdf/index.rdf
This file has been truncated, but you can view the full file.
<?xml version='1.0' encoding='utf-8'?>
<rdf:RDF xmlns:cc="http://creativecommons.org/ns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<cc:License rdf:about="http://creativecommons.org/licenses/by-nc-nd/2.0/">
<cc:legalcode rdf:resource="http://creativecommons.org/licenses/by-nc-nd/2.0/legalcode.en" />
<cc:licenseClass rdf:resource="http://creativecommons.org/licenses/" />
<cc:prohibits rdf:resource="http://creativecommons.org/ns#CommercialUse" />
<cc:requires rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:requires rdf:resource="http://creativecommons.org/ns#Notice" />
<dcterms:creator rdf:resource="http://creativecommons.org" />
<dcterms:hasVersion>2.0</dcterms:hasVersion>
@TimidRobot
TimidRobot / images.rdf
Created August 10, 2023 16:03
http http://localhost:8005/rdf/images.rdf
<?xml version='1.0' encoding='utf-8'?>
<rdf:RDF xmlns:exif="http://www.w3.org/2003/12/exif/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="http://licensebuttons.net/l/by-nc-nd/2.0/80x15.png">
<exif:height>15</exif:height>
<exif:width>80</exif:width>
</rdf:Description>
<rdf:Description rdf:about="http://licensebuttons.net/l/by-nc-nd/2.0/88x31.png">
<exif:height>31</exif:height>
<exif:width>88</exif:width>
</rdf:Description>