This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function markArchivedAsRead() { | |
var delayDays = 7; // will only impact emails more than 7 days old | |
var maxDate = new Date(); | |
maxDate.setDate(maxDate.getDate()-delayDays); // what was the date at that time? | |
//Look for unread emails that are older than 14 days and exclude starred emails | |
var threads = GmailApp.search('label:unread older_than:14d -is:starred'); | |
GmailApp.markThreadsRead(threads); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Run script in the root directory of the site | |
#Fix tag based functions that have eol and tabs in the tag | |
find . -name '*.cf*' -not -name '*.json' | xargs perl -i -0pe 's/(?:\G|\<cf)(?:(?!\>).)*\K\n\t+/ /g' | |
#Fix script based functions that also have eol and tabs | |
find . -name '*.cf*' -not -name '*.json' | xargs perl -i -0pe 's/(?:\G(?!\A)|\tpublic|\tremote|\tprivate)(?:(?!\)).)*?\K\n\t+/ /g' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Relocate Unread Count for Gmail | |
// @namespace http://elomental.com/ | |
// @version 1.0 | |
// @description Relocate the unread count to the left for Gmail labels | |
// @author Ryan Reaves | |
// @match https://mail.google.com/* | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js | |
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js | |
// @grant none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Script to split audiobook chapters into separate files using metadata | |
""" | |
from __future__ import print_function | |
import os | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# permanent apple keyboard keyswap | |
echo "options hid_apple swap_opt_cmd=1" | sudo tee -a /etc/modprobe.d/hid_apple.conf | |
update-initramfs -u -k all | |
# Temporary & instant apple keyboard keyswap | |
echo '1' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd | |
# Windows and Mac keyboards - GUI (Physical Alt is Ctrl, Physical Super is Alt, Physical Ctrl is Super) | |
setxkbmap -option;setxkbmap -option altwin:ctrl_alt_win |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add to .zshrc or .bashrc | |
alias pg=pingout | |
pingout(){ | |
ping 8.8.8.8 | awk -F" |=" '/time/{if($10>0 && $10<=70){printf "\033[1;32m%i\n\033[0m", $10}; if($10>70 && $10<=99){printf "\033[33m%i\n\033[0m", $10};if($10>99){printf "\033[31m%i\n\033[0m", $10 }}' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Single Command, runs 2 calls to gdbus to get the currently active Window from Gnome 3.x | |
# Escaped so you can copy and paste into terminal directly | |
gdbus call -e -d org.gnome.Shell -o /org/gnome/Shell -m org.gnome.Shell.Eval global.get_window_actors\(\)[`gdbus call -e -d org.gnome.Shell -o /org/gnome/Shell -m org.gnome.Shell.Eval global.get_window_actors\(\).findIndex\(a\=\>a.meta_window.has_focus\(\)===true\) | cut -d"'" -f 2`].get_meta_window\(\).get_wm_class\(\) | cut -d'"' -f 2 | |
# Unescaped version, will not run | |
# Broken down into 2 commands. | |
# Call to Gnome to get the array location of the active Application | |
gdbus call -e -d org.gnome.Shell -o /org/gnome/Shell -m \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Fixes the macOS keymap on the host to swap Alt & Cmd | |
# This allows for proper key location when using Virtual Machines under VirtualBox | |
# Support for Vmware and Parallels can easily be added via the app names | |
# Also Virtualbox does not detect the keyswap initially, so another app has to | |
# steal focus and then return focus to VirtualBox. Unknown if the same applies | |
# to the other VM solutions. | |
from AppKit import NSWorkspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reference | |
# https://developer.apple.com/library/archive/technotes/tn2450/_index.html | |
# | |
# How to swap wordwise shortcuts to align with Windows/Linux | |
# http://benogle.com/2010/01/18/windowslinux-developers-remap-your-mac.html | |
# https://theconfused.me/blog/switching-between-mac-and-linux-keyboards/ | |
# | |
# Swap cmd & alt to Windows/Linux style | |
# left cmd = e3 | |
# left alt = e2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Original reference https://yulistic.gitlab.io/2017/12/linux-keymapping-with-udev-hwdb/ | |
systemd --version | head -n1 | awk '{print $2}' | |
# note systemd versions below 220 need | |
# keyboard:usb:v*p* | |
# 220 and above | |
# evdev:name:<name>:* |
OlderNewer