Skip to content

Instantly share code, notes, and snippets.

View gavinhungry's full-sized avatar

Gavin Lloyd gavinhungry

View GitHub Profile
@gavinhungry
gavinhungry / auto-basic-auth.js
Last active May 27, 2022 22:58
Auto Basic Auth
(() => {
/*
chrome.storage.local.set({
credentials: {
'example.com': {
username: 'foo',
password: '***'
}
}
});
@gavinhungry
gavinhungry / js-date-formats.js
Last active April 4, 2018 17:30
JavaScript Date formats
// because I can never remember what all of the Date output formats look like
Object.getOwnPropertyNames(Date.prototype).filter(m => m.startsWith('to')).forEach(m => {
console.log(m.padEnd(20), new Date()[m]());
});
@gavinhungry
gavinhungry / service-worker-killer.user.js
Last active December 21, 2022 19:30
Service Worker Killer
// ==UserScript==
// @name Service Worker Killer
// @version 0.4.0
// @description Unregister ServiceWorker(s) before page unload
// @author Gavin Lloyd <gavinhungry@gmail.com>
// @match http://*/*
// @match https://*/*
// @grant none
// ==/UserScript==
@gavinhungry
gavinhungry / thinkpad-input.sh
Last active June 8, 2022 23:16
ThinkPad input settings
synclient VertScrollDelta=-60 HorizScrollDelta=-60
synclient PalmDetect=1 PalmMinZ=100 PalmMinWidth=7
synclient RightButtonAreaTop=0 RightButtonAreaLeft=0
synclient CoastingFriction=75
xinput set-prop "$TOUCHPAD" 'Device Accel Profile' 2
xinput set-prop "$TOUCHPAD" 'Device Accel Constant Deceleration' 25
xinput set-prop "$TOUCHPAD" 'Device Accel Velocity Scaling' 10000
xinput set-prop "$TRACKPOINT" 'libinput Natural Scrolling Enabled' 1
@gavinhungry
gavinhungry / org.gnome.ScreenSaver.py
Last active May 27, 2022 23:03
D-Bus service providing org.gnome.ScreenSaver GetActive method for xsecurelock
#!/usr/bin/env python2
# /usr/share/dbus-1/scripts/org.gnome.ScreenSaver.py
import dbus
import dbus.mainloop.glib
import dbus.service
import gobject
import psutil
@gavinhungry
gavinhungry / nginx-tls.conf
Last active July 18, 2024 11:35
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Name: nginx-tls.conf
# Auth: Gavin Lloyd <gavinhungry@gmail.com>
# Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
#
# Enables HTTP/2, PFS, HSTS and OCSP stapling. Configuration options not related
# to SSL/TLS are not included here.
#
# Additional tips:
#