Skip to content

Instantly share code, notes, and snippets.

View Fishbowler's full-sized avatar

Dan Caseley Fishbowler

View GitHub Profile
@Fishbowler
Fishbowler / checkCopyrightHeader
Created December 17, 2023 13:44
Check and Update license and copyright headers in Openfire source files
#!/bin/bash
# This script checks for the presence of the current year in the license header of all java files in the repo.
# Originally inspired by (and somewhat copied from) https://github.com/palaniraja/whatchanged/blob/master/whatchanged.sh
THIS_YEAR=$(date +%Y)
IGNITE_FOUNDED="2016-10-21"
JIVE_ENDED="2010-01-31"
REPO_STARTED="2004-10-17"
@Fishbowler
Fishbowler / .bash_aliases
Last active January 19, 2022 19:46
Bash alias for launching Openfire in a docker container
# First param is the image tag
# Second param is optional and passed to the launcher
# examples:
# ofdocker latest
# ofdocker mybranch -demoboot
function ofdocker(){
DOCKERCMD="docker run"
DOCKERCMD="${DOCKERCMD} --rm -it"
DOCKERCMD="${DOCKERCMD} -p 3478:3478/tcp -p 3479:3479/tcp -p 5222:5222/tcp -p 5223:5223/tcp"
@Fishbowler
Fishbowler / update.sql
Last active May 31, 2021 20:59
Update Kodi Library after moving source
-- Written for when a LAN media source changes IP - you want all the same scanned media, watched state, etc, not having to start fresh
-- Caveats:
-- * Only covers videos, I don't anything else on Kodi
-- * SQLLite is intentionally feature-light, making this script a little longer than you'd expect, and a little clunky to use
-- Instructions:
-- * Fetch the latest MyVideos database from your userdata (in my case, this was from an Nvidia Shield)
-- * Run this on a copy in case it goes wrong!
-- * Set the variables
@Fishbowler
Fishbowler / noConsoleErrors.js
Created January 15, 2020 10:46
Nightwatch custom assertion for No Console Errors
/**
* Checks that the browser console log currently contains zero errors
*
* ```
* this.demoTest = function (client) {
* browser.assert.noConsoleErrors("Checking console for errors");
* };
*
* this.demoTest = function (client) {
* browser.assert.noConsoleErrors("reports/console.log","Checking console for errors");
@Fishbowler
Fishbowler / tabability.js
Created July 29, 2019 10:16
Tabability
javascript:(function () { var inputs = Array.apply(null, document.querySelectorAll("input, select, button, a")).filter(elem => elem.getBoundingClientRect().left != 0); for (I = 0; I < inputs.length; I++) { var currentInput = inputs[I].getBoundingClientRect(); var nextInput = null; if (I < inputs.length - 1) { nextInput = inputs[I + 1].getBoundingClientRect(); } else { lastInput = inputs[I]; nextInput = currentInput } var currentInputLeft = currentInput.left + (currentInput.width / 2); var currentInputTop = currentInput.top + (currentInput.height / 2); var nextInputLeft = nextInput.left + (nextInput.width / 2); var nextInputTop = nextInput.top + (nextInput.height / 2); if (I == 0) { document.body.insertAdjacentHTML('afterbegin', '<svg style="position:absolute;z-index:5555;height:100%;width:100%;" ><line x1="0" y1="0" x2="' + currentInputLeft + '" y2="' + currentInputTop + '" style="stroke:rgb(255,0,0);stroke-width:3" /><circle cx="' + currentInputLeft + '" cy="' + currentInputTop + '" r="3" stroke="red"/></svg