Skip to content

Instantly share code, notes, and snippets.

Avatar
👹
Ducking and diving

Daniel Pett portableant

👹
Ducking and diving
View GitHub Profile
@portableant
portableant / replacer.py
Created Jan 6, 2020 — forked from meddulla/replacer.py
Script to recursively replace string in filename and contents
View replacer.py
"""
Usage: python script.py search_string replace_string dir
Eg. python batchreplace.py galleries productions /Sites/cjc/application/modules/productions/
And it will search recursively in dir
and replace search_string in contents
and in filenames.
Case-sensitive
"""
from sys import argv
@portableant
portableant / findit.py
Last active Apr 1, 2017 — forked from paregorios/findit.py
How to find all Pleiades URIs that correspond to a Trismegistos place URI
View findit.py
# read in the json and get the graph of places
import json
import urllib.request, urllib.parse, urllib.error
import gzip
import os
latest = "http://atlantides.org/downloads/pleiades/json/pleiades-places-latest.json.gz"
fn = os.path.join(os.getcwd(), os.path.basename(latest))
urllib.request.urlretrieve(latest, fn)
@portableant
portableant / setting-up-earls-heroku.md
Last active Aug 29, 2015 — forked from shawngraham/setting-up-earls-heroku.md
steps for setting up @edsu's EARLS on Heroku;
View setting-up-earls-heroku.md

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

View autopgsqlbackup
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
View gist:9914316
@prefix cito: <http://purl.org/spar/cito> .
@prefix cnt: <http://www.w3.org/2011/content> .
@prefix dc: <http://purl.org/dc/terms> .
@prefix lawd: <http://lawd.info/ontology> .
<http://edh-www.adw.uni-heidelberg.de/resources/people/HD000001/1>
a lawd:Person ;
dc:publisher <http://edh-www.adw.uni-heidelberg.de> ;
lawd:hasName <http://edh-www.adw.uni-heidelberg.de/resources/people/HD000001/1#name> ;
lawd:hasAttestation <http://edh-www.adw.uni-heidelberg.de/resources/people/HD000001/1#attestation> .