Skip to content

Instantly share code, notes, and snippets.

View CatChapman's full-sized avatar
🕷️

Cat Chapman CatChapman

🕷️
  • Pacific Northwest
View GitHub Profile
@CatChapman
CatChapman / grab-metadata-from-IDs.sh
Created May 27, 2026 06:13
Grab Title, Email from the GBIF Registry given a list of Publisher GUIDs
#! /bin/bash
#I wrote this because I had a list of ~500 publisher IDs, and needed their corresponding titles and contact emails.
#This script loops through lines in a plaintext file (this file should consist of GUIDs on their own lines, and nothing else)
#It grabs the GUID from the file and feeds it into the curl command
#The curl command queries the GBIF Registry API for the plugged in GUID ($line)
#It then pipes the output to jq, which grabs the key (GUID - redundant, but I wanted to easily check that it was working) title, and email values
#It does some custom text formatting magic so that the values are comma separated for easy (lazy) import into a csv, especially since the @csv option for jq kept saying the data type for the .email values weren't appropriate for CSV or some such
#and then you get nice normalized output on the screen, like: 533ae0fc-1f4d-4a43-a578-be7a9c874857,University of North Carolina Wilmington,["email@fakeemail.nospam"]

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

@CatChapman
CatChapman / recordcount_from_recordsetID_list.r
Created March 18, 2020 18:51
iDigBio Record Count from list of Recordset IDs
#In this example I used a single-column CSV file, rsets.csv with a header - "rsets" - containing a list of 473 iDigBio recordsetIDs.
#load the ridigbio library
library(ridigbio)
#read and load the CSV into R, as "symbsets"
symbsets <- read.csv("/Users/caitlin.chapman/Code stuff/json/rsets.csv")
#idig_count_records() returns the number of records for a given query - in this case, we are querying the number of records
#in an entire recordset, querying for recordset ID (e.g. recordset="9c963109-9898-4953-a351-d5ee36d6115b")