Skip to content

Instantly share code, notes, and snippets.

@metaquanta
metaquanta / gmail_unread_sections.user.js
Last active April 12, 2017 09:54
Gmail Priority Inbox - Labelled and Unread Sections
Array.from(
document.querySelectorAll('div.J-N')
).filter(
function(option) {
return option.attributes.cfg && option.attributes.cfg.nodeValue.indexOf("^all,") != -1;
}
).forEach(
function(option) {
option.attributes.cfg.nodeValue = option.attributes.cfg.nodeValue.replace("^all","^u");
option.firstChild.innerText = option.firstChild.innerText + " and unread";
@metaquanta
metaquanta / shutdown_eclipse.sh
Last active July 28, 2016 21:21
For when you need to quit an Eclipse running in a different X session:
#!/bin/sh
ECLIPSE_VERSION=46
ECLIPSE_HOME= ## path to the jar referenced in the next line ##
ECLIPSE_CMDLINE_MATCH="jar ${ECLIPSE_HOME}/plugins/org.eclipse.equinox.launcher"
# This just leaves an orphan
killall eclipse${ECLIPSE_VERSION} 2> /dev/null
# This still just leaves an orphan
killall eclipse 2> /dev/null
#!/bin/sh
echo "gem: --no-ri --no-rdoc" >> ~/.gemrc