Skip to content

Instantly share code, notes, and snippets.

View damoclark's full-sized avatar

Damien Clark damoclark

View GitHub Profile
@damoclark
damoclark / global.gitignore
Last active July 27, 2018 04:39 — forked from octocat/.gitignore
My global git ignore file, added with command git config --global core.excludesfile <path to this file>
#global git ignore file, add with command git config --global core.excludesfile <path to this file>
# Testing scripts #
###################
test-*.php
# Typescripts #
###################
typescript*
@damoclark
damoclark / README-template.md
Last active November 20, 2017 17:44
Github README.md Template

GitHub Markup

This library is the first step of a journey that every markup file in a repository goes on before it is rendered on GitHub.com:

  1. This library converts the raw markup to HTML. See the list of supported markup formats below.
  2. The HTML is sanitized, aggressively removing things that could harm you and your kin—such as script tags, inline-styles, and class or id attributes. See the sanitization filter for the full whitelist.
  3. Syntax highlighting is performed on code blocks. See github/linguist for more information about syntax highlighting.
  4. The HTML is passed through other filters in the html-pipeline that add special sauce, such as emoji, [task lists](https://github.com/github/task_li
@damoclark
damoclark / git-remote-show-origin-all.sh
Last active August 29, 2015 14:24
Show the origin of all git repos under the current working directory
#!/bin/sh
#Call this script like so:
# $ cd <location of all your repos>
# $ find . -type d -name .git -printf "%h\0"|xargs -0 -n 1 git-remote-show-origin-all.sh 2>/dev/null | sort
#Ignore any vendor repos
echo "$1" | grep -q vendor && exit
cd "$1"
@damoclark
damoclark / autopgsqlbackup
Created October 22, 2015 01:04 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
#!/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
@damoclark
damoclark / backup.sh
Created November 7, 2015 07:29
Simple Bash 4.x shell script for backing up RHEL/CentOS Linux using ext filesystem dump utility (incomplete)
#!/bin/bash
#Load configuration options from filename passed in on command line
. $1
################## SAMPLE config file contents ##################
##!/bin/sh
#
#host=`hostname`
##Get date and time of commencement of backup
@damoclark
damoclark / GM_XHR.js
Last active January 15, 2016 04:04 — forked from monperrus/GM_XHR.js
allows using all Jquery AJAX methods in Greasemonkey
// allows using all Jquery AJAX methods in Greasemonkey
// https://gist.github.com/damoclark/f01b957797b7dd2c33d6
// https://gist.github.com/monperrus/999065
// inspired from http://ryangreenberg.com/archives/2010/03/greasemonkey_jquery.php
// works with JQuery 1.5
// (c) 2016 Damien Clark
// (c) 2011 Martin Monperrus
// (c) 2010 Ryan Greenberg
//
// Example usage with JQuery:
@damoclark
damoclark / io.adafruit.com-bridge.conf
Last active December 15, 2016 00:37 — forked from tdack/io.adafruit.com-bridge.conf
Bridge Mosquitto MQTT broker to io.adafruit.com MQTT broker to use with io.adafruit.com
# Connection name
connection adafruit
# Secure SSL/TLS
address io.adafruit.com:8883
# adjust path as approriate to point to directory with PEM encoded .crt CA files
bridge_capath /etc/ssl/certs/
# For CentOS 7 (and other RHEL derivatives), use this directive instead of bridge_capath
# bridge_cafile /etc/ssl/certs/ca-bundle.crt
@damoclark
damoclark / raspbian-localisation.sh
Last active January 22, 2017 10:15
Shell script to configure Raspbian Jessie for Queensland Australia
#LOCALE
sudo perl -p -i -e 's/^(en_GB.*)$/# $1/ ; s/^# en_AU\.UTF-8 UTF-8$/en_AU.UTF-8 UTF-8/ ;' /etc/locale.gen
sudo locale-gen
#TIMEZONE
sudo rm /etc/localtime
sudo ln -s /usr/share/zoneinfo/Australia/Queensland /etc/localtime
sudo rm /etc/timezone
echo "Australia/Queensland" | sudo tee /etc/timezone
#KEYBOARD
@damoclark
damoclark / gm4-polyfill.module.js
Last active August 12, 2019 06:00
This helper script bridges compatibility between the Greasemonkey 4 APIs and existing/legacy APIs.
/*
This helper script bridges compatibility between the Greasemonkey 4 APIs and
existing/legacy APIs. Say for example your user script includes
// @grant GM_getValue
And you'd like to be compatible with both Greasemonkey 4 and Greasemonkey 4
(and for that matter all versions of Violentmonkey, Tampermonkey, and any other
user script engine). Add:
@damoclark
damoclark / .eslintignore
Last active August 6, 2018 07:17
eslint
node_modules
tmp