Skip to content

Instantly share code, notes, and snippets.

View j13k's full-sized avatar

John Fitzpatrick j13k

View GitHub Profile
@j13k
j13k / prime_wordpress_website_cache.sh
Created November 21, 2022 08:08
Primes a WordPress website cache by crawling each resource linked in sitemap.xml.
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
usage() {
@j13k
j13k / vic-suburb-locality-boundaries.geojson
Last active July 18, 2019 02:39
VIC Suburb/Locality Boundaries - PSMA Administrative Boundaries GeoJSON
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@j13k
j13k / _design_groups.json
Last active April 5, 2019 03:01
Attempt to do CouchDB filtered replication by view
{
"_id": "_design/groups",
"views": {
"itemsByGroup": {
"map": "function(doc) {\n if (doc.type == 'group') {\n for (var i in doc.itemIds) {\n emit([doc._id, i], {_id: doc.itemIds[i]});\n }\n }\n}"
}
}
}
@j13k
j13k / git_svn_bash_prompt.sh
Created April 9, 2018 06:51 — forked from woods/git_svn_bash_prompt.sh
Set color bash prompt according to git/svn branch, and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE:
@j13k
j13k / userstyle-obeythetestinggoat.css
Created April 3, 2018 01:55
User stylesheet for Test-Driven Development with Python online book
/**
* Applies updated Asciidoctor default stylesheet to online
* edition of "Test-Driven Development with Python".
*
* 1. Install 'Stylish' browser extension
* 2. Create New Style
* 3. Paste this stylesheet
* 4. Apply to URLs starting with
* https://www.obeythetestinggoat.com/book/
*

Keybase proof

I hereby claim:

  • I am j13k on github.
  • I am j13k (https://keybase.io/j13k) on keybase.
  • I have a public key ASBzbos4-B65mKoH5498hGXHETDrbh1-FyMsKUPzEy0sggo

To claim this, I am signing this object:

@j13k
j13k / post-checkout
Last active February 28, 2017 05:34 — forked from lyrixx/post-checkout
A post-checkout hook script to check Composer package status and warn of changes after switching branches
#!/bin/bash
#
# A post-checkout hook script to check Composer package status
# and warn of changes after switching branches.
#
# Put this file at: .git/hooks/post-checkout
# and make it executable
# You can install it system wide too, see http://stackoverflow.com/a/2293578/685587
PREV_COMMIT=$1
@j13k
j13k / rsync_backup.sh
Created April 1, 2016 10:11 — forked from tvwerkhoven/rsync_backup.sh
Improved script: - Check if run as root - Clarify rsync(1) flags - Add --inplace for performance, extra preservation flags - Check bless(8) target before setting Improved exclusion file: - Included files listed by Carbon Copy Cloner
#!/bin/bash
#
# This script backups an OS X system to an external volume, effectively
# cloning it. It is based on [0], [1] and [2] for OS X and [3] and [4] for
# Linux. One could also use commercial tools like SuperDuper! or Carbon Copy
# Cloner. The latter website has an interesting list[5] on what files to
# exclude when cloning.
#
# Exclusions (from CCC[5]), see rsync_excludes_osx.txt
#
@j13k
j13k / userstyle-google-com.css
Last active March 18, 2016 08:41
Google Apps User Styles
/* Sets default font */
body,
td,
input,
textarea,
select {
font: 14px tahoma, "San Francisco", arial, sans-serif
}
/* Removes Google Plus gadget beside message content */
div.no > div.nH.aNW.apk.nn > div > div > table > tr > td.Bu.y3 {
@j13k
j13k / projects.ini
Last active August 29, 2015 14:18
Sample file for INI-based Sismo project configuration
;
; Sample config for INI-file based Sismo project configuration
;
; Requires a counterpart config.php script, which is available as a gist:
; https://gist.github.com/j13k/4addfc987570acb82db2
;
[project1]
type = github
name = Twig
slug = twig