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
# /etc/acpi/events/thinkpad-dock | |
# This is called when the Thinkpad docks in a series 3 docking station | |
event=ibm/hotkey HKEY 00000080 00004010 | |
action=/etc/acpi/thinkpad-dock.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
const dgram = require('dgram'); | |
let server = dgram.createSocket('udp4'); | |
function bind(socket, port = 8088, address = '0.0.0.0', callback = () => {}) { | |
socket.bind(port, address, callback); | |
} | |
// Bind server only if module was run directly, eg. node server.js | |
if (require.main === module) { |
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
const os = require('os'); | |
const exec = require('child_process').exec; | |
switch (os.platform()) { | |
case 'win32': | |
exec('yarn --version', (err, stdout, stderr) => { | |
if (err) { | |
exec('npm install'); | |
return; | |
} else { |
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
{ | |
"testEnvironment": "node", | |
"transform": { | |
"^.+\\.ts$": "ts-jest" | |
}, | |
"moduleFileExtensions": [ | |
"ts", | |
"js", | |
"json", | |
"node" |
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 python3 | |
"""Set iTerm2 color preset according to macOS theme. | |
Requires iTerm2 version 3.3 or newer. | |
Save as ~/Library/ApplicationSupport/iTerm2/Scripts/AutoLaunch/sync_theme.py and | |
enable under scripts menu in iTerm2. | |
""" |
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
<?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"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.18039216101169586</real> |
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
<scheme name="GitHub Dark" version="142" parent_scheme="Darcula"> | |
<metaInfo> | |
<property name="created">2020-07-20T12:05:56</property> | |
<property name="ide">Python</property> | |
<property name="ideVersion">2020.1.3.0.0</property> | |
<property name="modified">2020-07-20T12:05:58</property> | |
<property name="originalScheme">Github Dark</property> | |
</metaInfo> | |
<colors> | |
<option name="CARET_COLOR" value="c8e1ff" /> |
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 bash | |
# Update a Flatcar installation on VMWare to use the latest OEM content | |
# | |
# Copyright 2020, Neil Mayhew <[email protected]> | |
# LICENSE: MIT | |
set -ex | |
shopt -s extglob nullglob |
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
# Change the service variable to uniquely identify a service or area the key is intended for. | |
service="github" \ | |
now=$(date +'%Y%m%d') \ | |
name="$(whoami)@$(hostname -s | tr +'[:upper:]' +'[:lower:]')" \ | |
sh -c 'ssh-keygen -t ed25519 -f $HOME/.ssh/id_ed25519_$name_$service -C "$name-$service-$now"' |