Skip to content

Instantly share code, notes, and snippets.

View peterhartree's full-sized avatar

Peter Hartree peterhartree

View GitHub Profile
@peterhartree
peterhartree / its-ok-xero
Created July 25, 2023 22:37
Automate Xero reconcilliation
setInterval(() => {
let okayButtons = document.querySelectorAll('.okayButton');
okayButtons.forEach(button => {
if (getComputedStyle(button).display !== 'none') {
button.click();
}
});
}, 1000);
@peterhartree
peterhartree / gist:275c4bcddc8eb3fe563f5dbb59a27d68
Created May 24, 2020 11:23
Firefox hide pinned tab title change notification dot
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
/* Completely hide the "title changed" notification dot on pinned tabs */
.tabbrowser-tab > .tab-stack > .tab-content[pinned][titlechanged] {
background-image: none !important;
}
@peterhartree
peterhartree / messages.json
Created February 10, 2018 10:11
Inbox When Ready l18n
{
"appName": {
"message": "Inbox When Ready for Gmail™",
"description": "The name of the application, displayed in the web store."
},
"appDesc": {
"message": "Protect your focus... improve your inbox workflow.",
"description": "The short description of the application, displayed in the web store."
},
"inbox": {
/**
* This Google Sheets script keeps data in the specified column sorted any time
* the data changes.
*
* After much research, there wasn't an easy way to automatically keep a column
* sorted in Google Sheets, and creating a second sheet to act as a "view" to
* my primary one in order to achieve that was not an option. Instead, I
* created a script that watches for when a cell is edited and triggers
* an auto sort.
*
var waitTime = 0;
var maximumWaitTime = 1000 * 5; // 5 seconds
waitForSleeknoteToLoad(waitTime, maximumWaitTime);
function waitForSleeknoteToLoad(waitTime, maximumWaitTime) {
if(typeof SleekNote !== 'undefined' && typeof SleekNote.triggerOnclick === 'function'){
$(document).trigger('SleeknoteLoaded');
}
else {
waitTime += 1000;
@peterhartree
peterhartree / messages.json
Created April 14, 2017 11:26
Inbox When Ready l18n
{
"appName": {
"message": "Inbox When Ready for Gmail™",
"description": "The name of the application, displayed in the web store."
},
"appDesc": {
"message": "Protect your focus... improve your inbox workflow.",
"description": "The short description of the application, displayed in the web store."
},
"hideInbox": {
@peterhartree
peterhartree / messages.json
Created December 18, 2016 11:42
Inbox When Ready German l18n
{
"appName": {
"message": "Inbox When Ready für Gmail™",
"description": "The name of the application, displayed in the web store."
},
"appDesc": {
"message": "Schützen Sie Ihren Fokus... verstecken Sie Ihre Google Mail-Posteingang.",
"description": "The short description of the application, displayed in the web store."
},
"hideInbox": {
@peterhartree
peterhartree / beemind-me-in-the-morning.sh
Created January 30, 2016 20:31
Create a new Beeminder datapoint if current system time is within a given window.
# Create a new Beeminder datapoint if current system time is within a
# given window.
#
# Possible use case: if you're on OS X, you can trigger this script with
# the free ControlPlane app. This means you can automatically Beemind
# yourself to a given location before a given time.
#
# Originally made by @peterhartree in order to Beemind his way to the
# office bright and early. Check up on him at
# https://www.beeminder.com/peterhartree/goals/rcu :P
@peterhartree
peterhartree / wordpress-headlines.php
Last active December 28, 2015 12:29
How to use the SimplePie RSS library to display a list of linked article headlines from a Wordpress RSS feed on a non-Wordpress PHP page.
<?php
/** Outputs a list of linked article headlines from a Wordpress recent posts RSS feed. */
$simplepie_path = "includes/simplepie/"; // path to SimplePie RSS library
$feed_url = 'http://yourblog.com/feed/'; // url of your blog's RSS feed
$cache_location = $_SERVER['DOCUMENT_ROOT'] . '/includes/simplepie-cache'; // set cache directory (make sure that the directory exists and that this script can write to it)
$max_items = 3; // max feed items to show
$first_item = 0; // feed item to start from
require_once($simplepie_path.'autoloader.php');
h1,h2,h3,h4,h5,h6,em,.sok_font{font-family:"switchedonkidsnormal",Arial;text-transform:none;letter-spacing:0px;font-weight:normal;line-height:1.2;color:#fff; -webkit-text-fill-color:#fff;-webkit-text-stroke:1px #000;text-fill-color:#fff;text-stroke:1px #000}