Skip to content

Instantly share code, notes, and snippets.

Gavin Lloyd gavinhungry

Block or report user

Report or block gavinhungry

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gavinhungry
gavinhungry / 50-battery.rules
Last active May 18, 2019
udev script for handling power management
View 50-battery.rules
SUBSYSTEM=="power_supply", ACTION=="change", RUN+="/etc/scripts/battery.sh"
@gavinhungry
gavinhungry / nginx-tls.conf
Last active May 1, 2019
Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating
View nginx-tls.conf
#
# 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 omitted here.
#
# Example: https://www.ssllabs.com/ssltest/analyze.html?d=gavinhungry.io
#
@gavinhungry
gavinhungry / index.js
Last active Apr 5, 2019
Auto Basic Auth
View index.js
(() => {
/*
chrome.storage.local.set({
credentials: {
'example.com': {
username: 'foo',
password: '***'
}
}
});
@gavinhungry
gavinhungry / thinkpad-input.sh
Created Jan 7, 2018
ThinkPad input settings
View thinkpad-input.sh
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 chrome-theme-manifest.json
{
"manifest_version": 2,
"name": "gavinhungry",
"version": "0.0.0",
"theme": {
"colors": {
"frame": [ 202, 205, 210 ],
"frame_inactive": [ 202, 205, 210 ],
"background_tab": [ 202, 205, 210 ],
@gavinhungry
gavinhungry / gv-delete-history-legacy.user.js
Last active Nov 8, 2018 — forked from ljepson/gvoice.js
Browser userscripts to delete all Google Voice history
View gv-delete-history-legacy.user.js
// ==UserScript==
// @name Delete Google Voice (Legacy) History
// @description Deletes all Google Voice (Legacy) history
// @version 1.1.0
// @license MIT
// @namespace gavinhungry.io
// @author Gavin Lloyd <gavinhungry@gmail.com>
//
// @include https://www.google.tld/voice
// @include https://www.google.tld/voice/*
@gavinhungry
gavinhungry / 10-alarm-gpio.rules
Created Apr 15, 2018
udev rule to set RPi GPIO group on Arch Linux ARM
View 10-alarm-gpio.rules
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'"
@gavinhungry
gavinhungry / promise-with-state.js
Last active Apr 5, 2018
Promise wrapper with state getters (isPending, isFulfilled, isRejected)
View promise-with-state.js
/*
* 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
@gavinhungry
gavinhungry / RegFight.ps1
Last active Apr 5, 2018
PowerShell script to fight Group Policy and keep registry settings as desired
View RegFight.ps1
<##
# PowerShell script to fight Group Policy and keep registry settings as desired
#
# When taking ownership and removing rights from a registry key are not enough
#
# The author of this script feels quite satisfied that it is the worst
# PowerShell script ever written. If you agree, please feel free to provide
# suggestions, improvements, alternatives or looks of disapproval.
#
# Update:
@gavinhungry
gavinhungry / js-date-formats.js
Last active Apr 4, 2018
JavaScript Date formats
View js-date-formats.js
// 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]());
});
You can’t perform that action at this time.