Skip to content

Instantly share code, notes, and snippets.


Quinn Comendant quinncomendant

View GitHub Profile
quinncomendant / .htaccess for WP subdirectory installation
Last active Aug 7, 2021
This .htaccess file works with Wordpress installed under a subdirectory wp/ inside the document root.
View .htaccess for WP subdirectory installation
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
# Make the admin still accessible from /wp-admin
RewriteCond %{REQUEST_URI} ^/wp-admin/?(.*)
RewriteRule .* wp/wp-admin/$1 [L,R=301]
RewriteCond %{REQUEST_URI} ^/wp/?$
RewriteRule .* wp/wp-admin/ [L,R=301]
# Base is the URL path of the home directory
RewriteBase /
quinncomendant /
Created Feb 13, 2021
Downloads a chrome extension matching ExtensionID to ~/src/chrome-webstore-{ExtensionID}
#!/usr/bin/env bash
# Quinn Comendant <>
# 29 Sep 2017 16:09:21
# Functions
quinncomendant / umbrella
Last active Jan 21, 2021
[WARNING: this script no longer works with newer versions of the roaming client software, which now has a *Disable* control in its menu so use that instead.] Cisco Umbrella Roaming Client management script for Mac OS X. This makes it easy to manage the background processes of umbrella to start, stop, restart, sleep and get status.
View umbrella
# Quinn Comendant <>
# Since 25 Jan 2015
# Version 1.2.2
# q 13942 0.0 0.3 4408332 22096 ?? SN 7:32PM 0:00.27 /Applications/OpenDNS Roaming Client/
# nobody 13937 0.0 0.1 4296740 5164 ?? Ss 7:31PM 0:00.06 /usr/local/sbin/dnscrypt-proxy --user nobody --local-address= -d
# root 13903 0.0 0.2 4366308 13752 ?? SNs 7:31PM 0:00.25 /Library/Application Support/OpenDNS Roaming Client/dns-updater
quinncomendant / post-receive
Last active Oct 26, 2019
Use this script as `deploy.git/hooks/post-receive` in a bare git repo (`git init --bare`) on a server to deploy application files with `git push production master`.
View post-receive
#!/usr/bin/env bash
# Config
mkdir -p -m 0777 $(dirname $LOGFILE);
touch $LOGFILE;
# Use variables from STDIN.
quinncomendant / Autosave.js
Created Sep 3, 2019
Autosave module makes it easy to save and load form values in localStorage.
View Autosave.js
// Maintain state of form values across page loads with localStorage.
// eslint-disable-next-line no-unused-vars
var Autosave = (function ($) {
'use strict';
// Options
quinncomendant / dscovr-epic-desktop
Last active Sep 13, 2018
This is an OS X command-line script that downloads the latest DSCOVR:EPIC <> image and sets it as your desktop picture. Prerequisites: requires installing Homebrew <> and then the jshon tool (`brew install jshon`). Then you can run the command manually, or add it to your crontab.
View dscovr-epic-desktop
#!/usr/bin/env bash
curl -s "$apiurl" | jshon -a -e image -u | while read image; do
mkdir -p "$download_directory";
if [[ -n "$image" && ! -f "$destfile" ]]; then
echo "New 🌍 ! $image.jpg";
curl -so "$destfile" "$image.jpg";
ln -sf "$destfile" "$download_directory/latest.jpg";
quinncomendant /
Created May 24, 2018
This is Peter Samuel’s script, adapted to prepend a X-AuthUser header for mail sent via
#!/usr/bin/perl -w
# $Id:,v 1.3 2007/03/06 14:55:09 psamuel Exp $
# qmail-queue wrapper program.
# This program should be used when you wish to manipulate a mail
# message BEFORE it is placed in the queue. Possible uses include:
# - header rewriting
View Informal

A list of contractions from divinewrite and a regex to find and eradicate the more unseemly from your documents (remember to use a case-insensitive search).

Regex to catch both the “least formal” and “less formal” contractions:


Least formal

Regex to catch these:

quinncomendant /
Last active Sep 21, 2017
Instructions to install dnscrypt-proxy via Homebrew on macOS

Prevent DNS leaks on macOS by using dnscrypt-proxy. dnscrypt-proxy is available for installation via Homebrew, and comes configured to use OpenDNS servers. After installing, dnscrypt-proxy will always run in the background and encrypt all your DNS queries:

  1. Open (press Command+Space and type terminal and hit return).
  2. Run in Terminal app: /usr/bin/ruby -e "$(curl -fsSL" and press enter/return key. Wait for the command to finish.
  3. Run in Terminal app: brew install dnscrypt-proxy and press enter/return key. Wait for the command to finish.
  4. Run a DNS leak test: click the Standard test and ensure all DNS servers are owned by
quinncomendant /
Last active Sep 7, 2017
Class for server-side submission of data to Google Analytics
* Class for server-side submission of data to Google Analytics.
* TODO: Would be better to save the request to a queue to process submissions in the background. Currently, requests are blocked until the POST to GA completes or timeout is reached.
* @author Quinn Comendant <>
* @version 1.0
* @since 24 Aug 2014 15:35:43