Skip to content

Instantly share code, notes, and snippets.

View liamdawson's full-sized avatar

Liam Dawson liamdawson

View GitHub Profile
@liamdawson
liamdawson / build-dyld_shared_cache_util.md
Last active April 27, 2023 23:56
dyld_shared_cache_util patch
@liamdawson
liamdawson / com.ldaws.CapslockEsc.plist
Last active April 9, 2023 07:34
Caps Lock -> Esc on macos
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Place in ~/Library/LaunchAgents/ -->
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.ldaws.CapslockEsc</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/hidutil</string>
@liamdawson
liamdawson / Gemfile
Created July 27, 2021 02:09
Extract a CSV of manual RDS DB snapshots in an AWS account
# frozen_string_literal: true
source "https://rubygems.org"
gem "aws-sdk-rds"
@liamdawson
liamdawson / 2.2.1-typo.patch
Created March 7, 2015 12:05
Fixes a typo in MRI Ruby 2.2.1 when installing via rbenv's ruby-build
--- tool/rbinstall.rb 2015-03-07 21:59:28.834830008 +1000
+++ tool/rbinstall.rb.patch 2015-03-07 21:59:43.202830008 +1000
@@ -711,7 +711,7 @@
install?(:ext, :comm, :gem) do
begin
require "zlib"
- rescue LoadErroe
+ rescue LoadError
end
if defined?(Zlib)
@liamdawson
liamdawson / README.md
Created October 5, 2020 22:29
Remap Capslock to Escape on Macos

Place the following file under ~/Library/LaunchAgents (e.g. ~/Library/LaunchAgents/com.ldaws.CapslockEsc.plist)

@liamdawson
liamdawson / token.sls
Last active February 7, 2020 19:32
Set a grain from an api call on a minion
#!py
# The following statefile uses Python to set a grain ('sample-token') to
# a value pulled from a HTTP call. The call will not be repeated if the
# grain is already set.
from salt.utils.http import query
import json
def run():
@liamdawson
liamdawson / icons.d.ts
Last active July 27, 2018 03:16
@githubprimer/octicons-react 8.0.0 typings
declare module "@githubprimer/octicons-react" {
import * as React from 'react'
type Icon<
W extends number = number,
H extends number = number
> = React.SFC<{}> & { size: [W, H] };
type Size = 'small' | 'medium' | 'large'
interface OcticonProps {
@liamdawson
liamdawson / typed-examples.tsx
Created July 27, 2018 02:48
Type usage examples for octicons-react
import React from 'react';
// all of the icons are auto-completeable in IDE imports
import Octicon, {Globe, getIconByName} from '@githubprimer/octicons-react';
import {storiesOf} from '@storybook/react';
storiesOf('Icon', module)
// won't compile, icon prop required
.add('Empty icon', () => <Octicon />)
// won't compile, string not assignable, needs to be Icon<x, y>, or a StatelessComponent
@liamdawson
liamdawson / gnome-ext-install.sh
Created February 8, 2018 00:52
Bash script to install extensions from the command line. *Use at your own risk!*
#!/bin/bash
set -e
set -u
version="0.0"
usage="$(basename $0) version $version
usage:
$(basename $0) install <extension-uuid> [<extension-id/uuid> ... ]
@liamdawson
liamdawson / AlwaysRunVS2017AsAdmin.reg
Last active January 18, 2018 20:35
Always Run Visual Studio 2017 as Administrator (64-bit)
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\Common7\\IDE\\devenv.exe"="RUNASADMIN"
"C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\MSEnv\\VSLauncher.exe"="RUNASADMIN"