Skip to content

Instantly share code, notes, and snippets.

Avatar

Peter Hartree peterhartree

View GitHub Profile
@peterhartree
peterhartree / gist:275c4bcddc8eb3fe563f5dbb59a27d68
Created May 24, 2020
Firefox hide pinned tab title change notification dot
View gist:275c4bcddc8eb3fe563f5dbb59a27d68
@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 Feb 10, 2018
Inbox When Ready l18n
View messages.json
{
"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": {
View Keep Column Sorted in Google Sheets.gs
/**
* 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.
*
View wait-for-sleeknote.js
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 Apr 14, 2017
Inbox When Ready l18n
View messages.json
{
"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 Dec 18, 2016
Inbox When Ready German l18n
View messages.json
{
"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 Jan 30, 2016
Create a new Beeminder datapoint if current system time is within a given window.
View beemind-me-in-the-morning.sh
# 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 Aug 29, 2015
Compensate for the Bootstrap fixed top navigation bar, and offset if WordPress admin bar is visible.
View _header.less
// 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.
View disable-plugins-when-doing-local-dev.php
<?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/
*/
@peterhartree
peterhartree / wp-capitalise-term-title.php
Created Aug 10, 2014
WordPress: Capitalise term title
View wp-capitalise-term-title.php
/**
* Capitalises the first letter of term title for display.
*/
function capitalise_term_titles( $term_obj ) {
$term_obj->name = ucfirst($term_obj->name);
return $term_obj;
}
add_filter( 'get_term', 'capitalise_term_titles' );