Skip to content

Instantly share code, notes, and snippets.

Avatar

Quinn Comendant quinncomendant

View GitHub Profile
@quinncomendant
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
quinncomendant / qmail-queue-wrapper.pl
Created May 24, 2018
This is Peter Samuel’s script, adapted to prepend a X-AuthUser header for mail sent via mailchannels.com
View qmail-queue-wrapper.pl
#!/usr/bin/perl -w
#
# $Id: qmail-queue-wrapper.pl,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 contractions.md

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:

\b((could|how|might|must|should|that|what|when|where|why|would|it)n?['‘’](d|ll|re|ve)|why['‘’]s|we['‘’](d|re|ve|ll)|s?he['‘’](s|d|ll)|(where|how|when|who)['‘’](s)|(who|you|it)['‘’](d)|(they|who)['‘’](ll|ve)|(might|must)n['‘’]t|i'd)\b

Least formal

Regex to catch these:

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

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 Terminal.app (press Command+Space and type terminal and hit return).
  2. Run in Terminal app: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 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 opendns.com.
@quinncomendant
quinncomendant / Analytics.inc.php
Last active Sep 7, 2017
Class for server-side submission of data to Google Analytics
View Analytics.inc.php
<?php
/*
* Analytics.inc.php
*
* 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 <quinn@strangecode.com>
* @version 1.0
* @since 24 Aug 2014 15:35:43
@quinncomendant
quinncomendant / spamdyke-sender-conf
Created May 6, 2017
Create a custom sender config file for spamdyke using a template
View spamdyke-sender-conf
#!/usr/bin/env bash
#
# Quinn Comendant <quinn@strangecode.com>
# 06 May 2017 14:45:53
#
# Functions
#
View selection.yml
version: '2'
volumes:
dbdata:
driver: local
services:
db:
image: mysql/mysql-server:5.7
ports:
- "3306:3306"
volumes:
@quinncomendant
quinncomendant / denominator-zone-list.sh
Last active Sep 27, 2016
Wrapper script for denominator to prevent overrunning API limits. It works by watching the output file, and every 3 zones that are saved, it will pause for 4 seconds (so at most 45 zones/minute are retrieved).
View denominator-zone-list.sh
#!/usr/bin/env bash
#
# Quinn Comendant <quinn@strangecode.com>
# 23 Sep 2016 19:31:05
#
# Functions
#
@quinncomendant
quinncomendant / podcasts.md
Last active Oct 21, 2016
Podcast subscriptions as of July 2016. Computer-readable OPML version at bottom can be imported into a podcatcher like iTunes.
View podcasts.md
@quinncomendant
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
SITEDIR="/path/to/deploy/location";
LOGFILE="$SITEDIR/log/deploy.log";
mkdir -p -m 0777 $(dirname $LOGFILE);
touch $LOGFILE;
# Use variables from STDIN.
You can’t perform that action at this time.