Skip to content

Instantly share code, notes, and snippets.

View RISCfuture's full-sized avatar
🌯

Tim Morgan RISCfuture

🌯
View GitHub Profile
@RISCfuture
RISCfuture / closest_unvisited_airport.py
Created December 4, 2025 09:25
Finds the closest airports to your home airport that you have NOT yet visited, according to your LogTen Pro for Mac logbook.
#!/usr/bin/env python3
"""
Find the closest airports you haven't flown to.
This tool analyzes your LogTen Pro logbook to find airports you haven't visited,
then uses FAA NASR data to calculate distances from your home airport and shows
the closest unvisited airports.
"""
import argparse
@RISCfuture
RISCfuture / tmaat.py
Created December 4, 2025 08:48
TMAAT (“Tell Me About a Time”) answer generator using an LLM and your LogTen Pro for Mac logbook
#!/usr/bin/env python3
"""
TMAAT Interview Prep - Generate airline interview answers from your LogTen Pro flight logbook.
Reads flight data from LogTen Pro SQLite database, identifies relevant stories using
keyword matching, and uses OpenAI GPT to generate STAR-format interview responses.
"""
import sqlite3
from dataclasses import dataclass
@RISCfuture
RISCfuture / generate_fiducial_markers.py
Created July 19, 2025 18:42
Generates fiducial markers to improve inside-out tracking for VR headsets. 100% vibe-coded by Claude.
#!/usr/bin/env python3
"""
Fiducial Marker Generator for VR Headset Tracking
This script generates unique, asymmetric fiducial markers with balanced
black/white pixel distribution and sufficient Hamming distance separation.
Each marker is output as a separate page in a PDF file.
"""
import sys
@RISCfuture
RISCfuture / 1pw-u2f.rb
Created July 29, 2023 04:02
Find sites in 1Password that support Universal Two-Factor
require 'json'
require 'uri'
require 'net/http'
require 'active_support/core_ext/enumerable'
directory_uri = URI.parse('https://api.2fa.directory/v3/all.json')
directory_sites = JSON.parse(Net::HTTP.get(directory_uri))
.map(&:last).index_by { |s| s['domain'] }
op_sites = JSON.parse(`op item list --categories login --format=json`)
@RISCfuture
RISCfuture / 1password-scan-fix.rb
Last active October 2, 2021 00:48
Scan and fix 1Password passwords
### 1password-scan-fix.rb ###
#
# This script locates 1Password passwords linked to URLs that either a)
# redirect to a newer URL or b) fail to load. For each of these URLs, you will
# be prompted as to whether you would like to modify or delete the URL.
#
# This script requires the
# [1Password CLI](https://1password.com/downloads/command-line/)
# (`brew install 1password-cli`). You will need to sign in to 1Password CLI
# by following the instructions on that web page first.
softwareupdate -i -a
if hash mas 2>/dev/null; then
mas upgrade
fi
if hash brew 2>/dev/null; then
brew update
brew upgrade
brew upgrade --cask --greedy
@RISCfuture
RISCfuture / typescript-vue.md
Last active October 22, 2025 18:39
Adding TypeScript to a Rails + Webpacker + Vue project

Adding TypeScript to a Rails + Webpacker + Vue project

These instructions assume you already have a Rails 5.2 project using Webpacker 4 with Vue 2 and Vuex 3. I'll show you how to add TypeScript to the project, and type-safe your Vue components, including single-file components (SFCs). This document will not teach you TypeScript syntax or type theory. It also assumes your code already works without TypeScript. You shouldn't use this article to, for example, get started with Vuex, because I'm leaving out lots of necessary boilerplate code and focusing just on TypeScript changes.

If you want to see a commit on a project accomplishing this migration, visit https://github.com/RISCfuture/AvFacts/commit/666a02e58b4626a074a03812ccdd193a3891a954.

Setup

  1. Run rails webpacker:install:typescript. This should modify config/webpacker.yml and config/webpack/environment.js (leave those changes), add tsconfig.json and config/webpack/loaders/typescript.js (leave those files), and add some other files in `a
@RISCfuture
RISCfuture / .rubocop.yml
Created March 13, 2018 19:57
WIP RuboCop
# Bundler/OrderedGems:
# Exclude:
# - 'Gemfile'
Layout/CaseIndentation:
IndentOneStep: true
Layout/DotPosition:
EnforcedStyle: trailing
@RISCfuture
RISCfuture / mdtable.rb
Created May 29, 2014 01:51
mdtable: Clean up Markdown tables in code comments and Markdown files
#!/usr/bin/env ruby
require 'find'
def parse_cells(row)
row.split('|').map(&:strip)[1..-1]
end
def header?(cells)
cells.all? { |cell| cell =~ /^:?\-+:?$/ }
@RISCfuture
RISCfuture / rails_template.rb
Last active September 30, 2015 20:27
Tim's Awesome Rails Template
# encoding: utf-8
require 'open3'
def rvm_env(cmd)
Open3.popen3 "bash -c 'source ~/.rvm/scripts/rvm && #{cmd}'" do |stdin, stdout, stderr, thread|
thread.join
end
end