View index.js
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
(() => { | |
document.addEventListener('wheel', e => { | |
if (e.ctrlKey) { | |
e.preventDefault(); | |
e.stopPropagation(); | |
} | |
}, { passive: false }); | |
})(); |
View index.js
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
(() => { | |
/* | |
chrome.storage.local.set({ | |
credentials: { | |
'example.com': { | |
username: 'foo', | |
password: '***' | |
} | |
} | |
}); |
View 10-alarm-gpio.rules
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
SUBSYSTEM=="gpio", ACTION=="add", PROGRAM="/bin/sh -c 'chgrp -R gpio /sys/class/gpio /sys/devices/platform/soc/*.gpio && chmod -R g+rw /sys/class/gpio /sys/devices/platform/soc/*.gpio'" |
View js-date-formats.js
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
// 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]()); | |
}); |
View promise-with-state.js
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
/* | |
* Create a new promise the same way as you would with the Promise constructor: | |
* | |
* let p = new PromiseWithState((res, rej) => { | |
* // ... | |
* }); | |
* | |
* p.isPending(); // true | |
* p.isFulfilled(); // false | |
* p.isRejected(); // false |
View service-worker-killer.user.js
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 Service Worker Killer | |
// @version 0.3.0 | |
// @description Unregister ServiceWorker(s) before page unload | |
// @author Gavin Lloyd <gavinhungry@gmail.com> | |
// @match * | |
// @grant none | |
// ==/UserScript== | |
(() => { |
View thinkpad-input.sh
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
synclient VertScrollDelta=-125 HorizScrollDelta=-125 | |
synclient PalmDetect=1 PalmMinZ=100 PalmMinWidth=7 | |
synclient RightButtonAreaTop=0 RightButtonAreaLeft=0 | |
synclient CoastingFriction=75 | |
TOUCHPAD='SynPS/2 Synaptics TouchPad' | |
xinput set-prop "$TOUCHPAD" 'Device Accel Profile' 2 | |
xinput set-prop "$TOUCHPAD" 'Device Accel Constant Deceleration' 40 | |
xinput set-prop "$TOUCHPAD" 'Device Accel Velocity Scaling' 10000 |
View 50-battery.rules
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
SUBSYSTEM=="power_supply", ACTION=="change", RUN+="/etc/scripts/battery.sh" |
View hand-scroll.user.js
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 Hand Scroll | |
// @namespace https://gavinhungry.io | |
// @version 1.5.0 | |
// @description Drag scrolling with mouse movement | |
// @author Gavin Lloyd <gavinhungry@gmail.com> | |
// @include * | |
// @grant none | |
// ==/UserScript== |
View org.gnome.ScreenSaver.py
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 python2 | |
import dbus | |
import dbus.mainloop.glib | |
import dbus.service | |
import gobject | |
import psutil | |
class ScreenSaver(dbus.service.Object): | |
def __init__(self): |
NewerOlder