Instantly share code, notes, and snippets.

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
#
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 ],
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/*
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'"
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
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:
View 50-battery.rules
SUBSYSTEM=="power_supply", ACTION=="change", RUN+="/etc/scripts/battery.sh"
View PKGBUILD
# $Id$
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>
pkgbase=nvidia
pkgname=(nvidia nvidia-dkms)
pkgver=387.34
_extramodules=extramodules-4.15-ARCH
pkgrel=23
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]());
});
View service-worker-killer.user.js
// ==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==
(() => {