Skip to content

Instantly share code, notes, and snippets.

Damo damoclark

Block or report user

Report or block damoclark

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bedifferent-renumber.user.js
// ==UserScript==
// @name mba-renumber
// @description Renumber unboxpages to ensure properly sequenced
// @version 1.0.0
// @grant none
// @include https://bedifferent.cqu.edu.au/*
// ==/UserScript==
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
module.exports = "span.diff span:last-of-type {background-color: yellow;}\nspan.diff ins {background-color: aqua;}\nspan.diff del {text-decoration-line: line-through;}\n";
@damoclark
damoclark / raspi-config.txt
Last active Jan 21, 2020
Simple Raspbian Configuration Tool. Add file to boot partition of SD Card and run single command after booting Raspbian.
View raspi-config.txt
#/bin/sh
#
# Don't change the following lines unless you know what you are doing
# They execute the config options starting with 'do_' below
grep -E -v -e '^\s*#' -e '^\s*$' <<END | \
sed -e 's/$//' -e 's/^\s*/\/usr\/bin\/raspi-config nonint /' | bash -x -
#
############# INSTRUCTIONS ###########
#
# Change following options starting with 'do_' to suit your configuration
@damoclark
damoclark / php_unserialize_to_json.sql
Last active Jan 30, 2019 — forked from storeman/php_unserialize_to_json.sql
PHP unserialize in Postgresql to json
View php_unserialize_to_json.sql
/**
Decode a php serialized value to json. This function only supports basic
data types:
- arrays (will always become a json object)
- booleans
- integers
- floats
- strings
- NULL
@damoclark
damoclark / gm4-polyfill.module.js
Last active Aug 12, 2019
This helper script bridges compatibility between the Greasemonkey 4 APIs and existing/legacy APIs.
View gm4-polyfill.module.js
/*
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 / raspbian-localisation.sh
Last active Jan 22, 2017
Shell script to configure Raspbian Jessie for Queensland Australia
View raspbian-localisation.sh
#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 / io.adafruit.com-bridge.conf
Last active Dec 15, 2016 — forked from tdack/io.adafruit.com-bridge.conf
Bridge Mosquitto MQTT broker to io.adafruit.com MQTT broker to use with io.adafruit.com
View io.adafruit.com-bridge.conf
# 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 / GM_XHR.js
Last active Jan 15, 2016 — forked from monperrus/GM_XHR.js
allows using all Jquery AJAX methods in Greasemonkey
View GM_XHR.js
// 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 / backup.sh
Created Nov 7, 2015
Simple Bash 4.x shell script for backing up RHEL/CentOS Linux using ext filesystem dump utility (incomplete)
View backup.sh
#!/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 / autopgsqlbackup
Created Oct 22, 2015 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
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
You can’t perform that action at this time.