Skip to content

Instantly share code, notes, and snippets.

View ross-spencer's full-sized avatar
πŸ’­
πŸ––

Ross Spencer ross-spencer

πŸ’­
πŸ––
View GitHub Profile
@ross-spencer
ross-spencer / envi.py
Created January 1, 2021 21:14
Example code for wrapping os.environ.get()
"""get_envi module
Consistently retrieve environment variables to use in your modules.
Try-it-out with:
`python -m pytest envi.py`
"""

AM - AtoM Docker Compose integration

Connect AM and AtoM Docker Compose environments using a shared external volume and other tweaks needed to test and develop DIP uploads between both applications.

  1. Setup both Docker Compose environments independently:

  2. Create local folder and Docker volume:

@ross-spencer
ross-spencer / mets_index.ascii
Last active July 22, 2020 15:51
METS/PREMIS as a table... (output plus code)
+----+-----------+----------------------------------------------------------------------------------------------------+
| | file_id | path |
|----+-----------+----------------------------------------------------------------------------------------------------|
| 0 | 81dad539 | objects/799px-Euroleague-LE_Roma_vs_Toulouse_IC-27.bmp |
| 1 | 8741d271 | objects/BBhelmet.ai |
| 2 | 98542eaa | objects/G31DS.TIF |
| 3 | c96e5ed0 | objects/Nemastylis_geminiflora_Flower.PNG |
| 4 | 9b48de44 | objects/Vector.NET-Free-Vector-Art-Pack-28-Freedom-Flight.eps |
| 5 | 74cf3a87 | objects/WFPC01.GIF
@ross-spencer
ross-spencer / composite.go
Created June 14, 2020 17:08
Composite interface in Golang
// Demonstration of composite interfaces in Golang. The demo isn't quite
// working as expected yet. I *think* I'd like to return an Object type from
// new() but that's not happening right now, primarily because I lose the
// composite/overriding effect I am trying to demonstrate.
package main
import (
"log"
"os"
)
@ross-spencer
ross-spencer / gist:2bc60f5ec16a738a80b762c0fb4932ec
Created April 30, 2020 13:58 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@ross-spencer
ross-spencer / make-skeleton-tzx.py
Last active December 30, 2020 18:52
Creating Skeleton Files in Batches Suitable for Testing
# -*- coding: utf-8 -*-
"""Create Skeleton sample files for testing."""
from __future__ import print_function
import os
import random
import sys
@ross-spencer
ross-spencer / weblate-atom-migration.md
Last active February 12, 2020 12:08
Weblate 2.x.x strings --> 2.x+1.x strings for AtoM

NOTE: To prepare a Weblate translation. Once a project has been created, under users, "review" must be set to enabled. Once that is done, all translations marked in XLIFF as approved will be imported as "approved". "Approved" status seems to be part of the function of the database in Weblate and selected behaviors as much as it is a part of the XLIFF model.

Process to export from AtoM 2.5.x project into an AtoM 2.6.x project

  1. Go to: https://translations.artefactual.com/projects/atom/25/#repository

  2. Commit and push remaining commits to atom/translations.

    • Permissions or ownership seem to affect when we can commit to, and push a Weblate translation. An instinct is that this is related to the way Docker is configured based on my interaction with Docker-compose in the Archivematica project where what is written to a mounted directory from the container will have different ownership than one might expect, especially. as Docker needs
@ross-spencer
ross-spencer / 2020-02-06-tdr-checklist.md
Last active July 14, 2021 09:38
TDR checklist in Markdown

AUDIT AND CERTIFICATION OF TRUSTWORTHY DIGITAL REPOSITORIES RECOMMENDED PRACTICE

CCSDS 652.0-M-1

MAGENTA BOOK (Extract)

September 2011

Trusted Digital Repository Checklist

3 ORGANIZATIONAL INFRASTRUCTURE

@ross-spencer
ross-spencer / fpr-queries.sql
Created November 29, 2019 12:18
Queries used for the FPR
This file has been truncated, but you can view the full file.
####################################################################################################
####################################################################################################
####################################################################################################
FPR table queries
Date: 2019-11-14
AM: 1.10.1
####################################################################################################
####################################################################################################
@ross-spencer
ross-spencer / serve.go
Created November 27, 2019 14:59
Test Archivematica callbacks
// Basic server capability to test storage service callbacks.
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"strings"
)