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 / _header.less
Last active August 29, 2015 14:09
Compensate for the Bootstrap fixed top navigation bar, and offset if WordPress admin bar is visible.
// Compensate for the Bootstrap fixed top navigation bar.
//
// No styleguide reference.
body {
padding-top: @navbar-height;
}
// Offset fixed top navigation bar if WordPress admin bar is
// visible.
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/