Skip to content

Instantly share code, notes, and snippets.

@tKe
tKe / keybase.md
Last active March 27, 2023 13:28
keybase.md

Keybase proof

I hereby claim:

  • I am tke on github.
  • I am phldavies (https://keybase.io/phldavies) on keybase.
  • I have a public key ASCFOuZT-qowa_z718UH3AbLGM6Bsl-XH_VfP64RLyOGCAo

To claim this, I am signing this object:

@tKe
tKe / aoc-leaderboard.sh
Created December 4, 2022 13:30
Advent of Code Leaderboard Log
#!/usr/bin/env sh
set -o errexit
set -o pipefail
readonly BOARD=${1?Missing leaderboard id}
readonly YEAR=${2:-$(date +%Y)}
readonly LOG_LIMIT=${3:-20}
readonly BOARD_CACHE="/tmp/.aoc-cache"
readonly BOARD_FILE="$BOARD_CACHE/leaderboard-$BOARD-$YEAR.json"
@tKe
tKe / seneca_plugin_promise_act.js
Created June 23, 2016 12:47
Example of broken promisifying of seneca.act from within a plugin
"use strict";
const Promise = require('bluebird');
require('seneca')()
.use(function testPlugin(options) {
const seneca = this;
const act = Promise.promisify(seneca.act, seneca);
seneca.add("cmd:test", (args, done) => {
act("cmd:log", {msg: "hello world"})
.then(r => done(null, r))
@tKe
tKe / elite-focus.ahk
Last active August 5, 2022 18:27
AutoHotkey Focus Elite: Dangerous on Joystick Movement
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
;#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force
SetFormat, float, 03 ;remove decimals from joystick values
;This script will activate your game window whenever
;any joystick axis changes. Handy for when you're
;Alt-Tabbed out of the game on your second monitor.