Skip to content

Instantly share code, notes, and snippets.

View portableant's full-sized avatar
Ducking and diving

Daniel Pett portableant

Ducking and diving
View GitHub Profile
portableant /
Created January 6, 2020 12:59 — forked from meddulla/
Script to recursively replace string in filename and contents
Usage: python search_string replace_string dir
Eg. python galleries productions /Sites/cjc/application/modules/productions/
And it will search recursively in dir
and replace search_string in contents
and in filenames.
from sys import argv
portableant /
Last active April 1, 2017 22:54 — forked from paregorios/
How to find all Pleiades URIs that correspond to a Trismegistos place URI
# read in the json and get the graph of places
import json
import urllib.request, urllib.parse, urllib.error
import gzip
import os
latest = ""
fn = os.path.join(os.getcwd(), os.path.basename(latest))
urllib.request.urlretrieve(latest, fn)
portableant /
Last active August 29, 2015 14:27 — forked from shawngraham/
steps for setting up @edsu's EARLS on Heroku;

Setting up EARLS

Earls is useful for archiving and counting URLS shared in tweets from a particular hashtag, eg., conference backchat etc. Getting it set up on Heroku (a tiered free service) is fairly straightforward. Getting it to go live requires a credit card tied to your account - but if you're using the free tier, this shouldn't be an issue. Anyway, with the help of Dan Pett I learned how to set one up. Dan set up an earls instance for #msudai.

getting ready

get a heroku account

install git

install node

# PostgreSQL Backup Script Ver 1.0
# Copyright (c) 2005 Aaron Axelsen <>
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@prefix cito: <> .
@prefix cnt: <> .
@prefix dc: <> .
@prefix lawd: <> .
a lawd:Person ;
dc:publisher <> ;
lawd:hasName <> ;
lawd:hasAttestation <> .