Skip to content

Instantly share code, notes, and snippets.

View ws's full-sized avatar

Will Smidlein ws

View GitHub Profile
@ws
ws / random_event.js
Created June 9, 2017 02:06
Find a random Facebook event (to bring yourself out of your comfort zone)
// Inspired by http://www.npr.org/sections/alltechconsidered/2017/06/08/531796329/eager-to-burst-his-own-bubble-a-techie-made-apps-to-randomize-his-life
// Literally all of the heavy lifting is done by https://github.com/tobilg/facebook-events-by-location-core
var EventSearch = require('facebook-events-by-location-core')
var es = new EventSearch({
"lat": 42.338998, // http://www.latlong.net/
"lng": -83.048520,
"distance": 250,
"accessToken": "YOURTOKENHERE" // https://developers.facebook.com/tools/accesstoken
@ws
ws / calculate-capital-gains.go
Created February 1, 2025 22:56
ETrade Capital Gains Calculator (Includes Quarterly Estimated Taxes)
// Thanks to @dantonnoriega for getting me started in the right direction:
// https://gist.github.com/dantonnoriega/fa0d3cdbb0b4012f217262c1bf405132
//
// To get your G&L_Collapsed.xlsx (quoting Dan's gist):
// Go to ETrade > Stock Plan > My Account > Gains & Losses.
// Select the proper tax year (e.g. 2022) then find the Download button towards the right side
// of the webpage below the Apply button.
// Click the Download button and select "Download Collapsed".
// This will download the appropriate excel sheet: G&L_Collapsed.xlsx.
//
@ws
ws / open-code-in-vscode.sh
Created March 11, 2025 21:14
Tell MacOS to use VScode for all code-like file extensions
#!/bin/bash
# This script sets Visual Studio Code as the default application for various code-related file extensions
# using `duti`. If `duti` is not installed, the script prompts the user to install it via Homebrew.
#
# Due to macOS system restrictions, setting .html as the default may fail if Chrome, VS Code, or other editors are open.
# In such cases, the script will notify the user to close those apps and retry.
# Check if duti is installed
if ! command -v duti &> /dev/null; then
@ws
ws / gist:6f959bef06e009e256783a941557fbfc
Created January 31, 2026 03:49
Mise wedow/ticket config
# git refs API returns tags in ascending order (unlike release API), so mise's .last() picks the latest
[tools."http:tk"]
version = "latest"
url = "https://raw.githubusercontent.com/wedow/ticket/v{{version}}/ticket"
rename_exe = { ticket = "tk" }
version_list_url = "https://api.github.com/repos/wedow/ticket/git/refs/tags"
version_regex = "refs/tags/v([0-9.]+)"