Skip to content

Instantly share code, notes, and snippets.

View davewongillies's full-sized avatar

Dave Wongillies davewongillies

View GitHub Profile
@davewongillies
davewongillies / HOWTO.md
Last active August 20, 2020 04:23
Flashing a QMK Proton C for use in a SpaceCat Launch Pad
@davewongillies
davewongillies / davewongillies.json
Created July 6, 2020 23:39
kbdfans kbd67mkii layout
{
"author": "David Gillies",
"documentation": "",
"keyboard": "kbdfans/kbd67/mkii_soldered",
"keymap": "davewongillies",
"layers": [
[
"KC_GRV",
"KC_1",
"KC_2",
@davewongillies
davewongillies / wakelock.service
Last active February 2, 2019 17:53
Lock screen after suspend with i3lock and systemd
# /etc/systemd/system/wakelock.service
[Unit]
Description=Lock the screen on resume from suspend
Before=sleep.target suspend.target
[Service]
User=daveg
Type=forking
Environment=DISPLAY=:0
@davewongillies
davewongillies / Instructions.md
Last active March 22, 2018 03:30
Disable whitespace in Github Pull Requests bookmarklet

Create a bookmark with the following code for the URL:

javascript:function ghnwsp()%7Bwindow.location%3Dwindow.location%2B%27%3Fw%3D1%27%3B%7Dghnwsp()%3Bvoid(0)

And then click it whenever you're looking at diffs to disable whitespace lines.

@davewongillies
davewongillies / Terraform_functions.md
Last active July 15, 2023 14:41
Terraform Functions

Supported built-in functions

  • abs(float) - Returns the absolute value of a given float. Example: abs(1) returns 1, and abs(-1) would also return 1, whereas abs(-3.14) would return 3.14. See also the signum function.

  • basename(path) - Returns the last element of a path.

  • base64decode(string) - Given a base64-encoded string, decodes it and returns the original string.

@davewongillies
davewongillies / aws_config.fish
Last active July 22, 2021 11:30 — forked from mbainter/aws_config.fish
Fish shell function to set your AWS credentials with MFA
function aws_config
if not fgrep -q "[$argv]" ~/.aws/credentials
echo "Please specify a valid profile."
else
set token_expired false
if test $AWS_SESSION_EXPIRY
set now (date +%s)
# WARNING: this date command only works with GNU date
@davewongillies
davewongillies / aws_config.fish
Created August 30, 2017 20:59 — forked from mbainter/aws_config.fish
Fish shell function to set your AWS credentials with MFA for use with Terraform
function aws_config
if not fgrep -q "[$argv]" ~/.aws/credentials
echo "Please specify a valid profile."
else
set -e AWS_ACCESS_KEY
set -e AWS_SECRET_KEY
set -g -x ATLAS_TOKEN (awk "/\[$argv\]/,/^\$/ { if (\$1 == \"atlas_token\") { print \$3 }}" ~/.aws/credentials)
set account (awk "/\[$argv\]/,/^\$/ { if (\$1 == \"account_id\") { print \$3 }}" ~/.aws/credentials)
set username (awk "/\[$argv\]/,/^\$/ { if (\$1 == \"username\") { print \$3 }}" ~/.aws/credentials)
set mfarn "arn:aws:iam::$account:mfa/$username"
@davewongillies
davewongillies / 00-README.md
Created July 9, 2017 04:56
udev rule to make TOMMO NEOGEOX Arcade Stick work with Linux

To make a TOMMO NEOGEOX Arcard Stick work with Linux, copy 10-tommo-neogeox.rules to /etc/udev/rules.d

@davewongillies
davewongillies / .ctags
Last active May 18, 2017 04:22 — forked from trlinkin/ctags
Ctags and vim-tagbar matching for Puppet Manifests - Based on http://comments.gmane.org/gmane.comp.sysutils.puppet.user/6152
# In your ~/.ctags
-h pp
--langdef=puppet
--langmap=puppet:.pp
--regex-puppet=/^[[:space:]]*class[[:space:]]*([a-z][a-zA-Z0-9_:\-]+)/\1/c,class/
--regex-puppet=/^[[:space:]]*stage[[:space:]]*([a-zA-Z0-9_:\-]+)/\1/t,stage/
--regex-puppet=/^[[:space:]]*site[[:space:]]*([a-zA-Z0-9_\-]+)/\1/s,site/
--regex-puppet=/^[[:space:]]*node[[:space:]]*[\'|\"]*([a-zA-Z0-9_\.\-]+)[\'|\"]*/\1/n,node/
--regex-puppet=/^[[:space:]]*define[[:space]]*([a-z][a-zA-Z0-9_:\-]+)/\1/d,definition/
@davewongillies
davewongillies / recipe.rb
Created April 22, 2016 11:13 — forked from mlafeldt/recipe.rb
Package Go tools with fpm-cookery (automatically uses godep dependencies if present)
class ChefRunner < FPM::Cookery::Recipe
GOPACKAGE = "github.com/mlafeldt/chef-runner"
name "chef-runner"
version "0.8.0"
revision 1
source "https://#{GOPACKAGE}/archive/v#{version}.tar.gz"
sha256 "a7de23f989f8353ecf838b551a8ceff09b83c8aeff2553b2c31d57615f8fcc53"
description "The fastest way to run Chef cookbooks"