Skip to content

Instantly share code, notes, and snippets.

View coolaj86's full-sized avatar
🐹 Go 🦎 Zig 📦 Node 🐧 POSIX 🪟 PowerShell

AJ ONeal coolaj86

🐹 Go 🦎 Zig 📦 Node 🐧 POSIX 🪟 PowerShell
View GitHub Profile
coolaj86 / view-dependent-tables-mysql.sql
Last active December 2, 2023 15:48
How to View Tables that Reference a Target Table in MySQL
-- call show_references_to('my_much_referenced_table') \G
my_table_name VARCHAR(255)
-- , my_column_name VARCHAR(255)
coolaj86 /
Last active October 20, 2023 19:40
POSIX, BSD, GNU, & IEEE Standard Command Line Flags & Options

POSIX & BSD Standard Command Line Flags & Options

The vital resource for developers creating new command-line tools to learn the wisdom of the ancients.

All programs should universally implement these flags:

  • -V (uppercase), --version, version
  • --help, help (also the default if nothing is given)
  • -- stop processing flags; treat all else as raw arguments

I'm creating a backup retention strategy with this directory structure:

├── daily
├── monthly
│  ├── 2019
│  └── 2020
└── weekly

Expected Output

coolaj86 / addMonth.js
Created December 8, 2022 18:16
Add `n` month to the current date, using the last day of the target month rather than rolling over to following month.
* Add `n` months to the current date.
* If the target month as fewer days than the source month
* (i.e. 28 or 29 vs 30, or 30 vs 31) then go to the last
* day of the month.
function addMonth(d, n) {
let d1 = d.getUTCDate();
let m1 = d.getUTCMonth();
coolaj86 /
Last active December 8, 2022 00:10
IRS e-File & e-Services Jargon

High-level Overview

  1. Very few people at the IRS have training on this. You'll have several phone calls and you'll have to explain what you're trying to do several times and be on hold a lot.
  2. A legal officer of the company must:
    • Create his personal account first
    • Apply for API or e-File, doesn't matter what - just needs to create the organization
    • Add himself as a Delegated user
  3. The developer can create an account
  4. The legal officer must add the developer as a Delegated User
  5. ???