Skip to content

Instantly share code, notes, and snippets.

View jspiro's full-sized avatar
:shipit:
const application:Application = Application(Application.application); // Sigh.

Jono Spiro jspiro

:shipit:
const application:Application = Application(Application.application); // Sigh.
View GitHub Profile
@jspiro
jspiro / git-magic-trick.md
Last active July 23, 2020 09:13
Migrate repo AND select branches/PRs into a monorepo WITHOUT retaining history

Preparation

  • Source repo should have as many branches and PRs closed or merged as possible
  • Rest of PRs should be merged with master just before migration begins

Prepare the initial commit of the migrated repo (master)

  1. Archive source repo
  2. Go to target directory in monorepo
  3. Clone source repo into correctly named folder in monorepo
  4. cd to repo and make all necessary changes for migration to monorepo (e.g. renaming)
  5. Commit all changes INSIDE the cloned repo on local master (commit name doesn't matter, DO NOT PUSH)
#!/bin/sh
grep pam_tid /etc/pam.d/sudo >/dev/null || echo auth sufficient pam_tid.so | cat - /etc/pam.d/sudo | sudo tee /etc/pam.d/sudo > /dev/null
@jspiro
jspiro / README.md
Last active October 29, 2023 23:37
How I do my bitcoin taxes

TurboTax has no crypto support, it also doesn't support importing CSVs of transactions, and CreditKarma has no ability to import from financial institutions at all (so e.g. wealthfront is an instant dealbreaker for trying it). Square sends out terrible CSVs of transactions and does very little to help you report for the few bucks you made.

  1. Import transactions to https://app.koinly.io/transactions
  2. Set tax basis to LIFO, print https://app.koinly.io/reports/2019 to PDF
  3. Load https://app.koinly.io/transactions?page=1 and find the transactions JSON transfer in the Network tab, Copy as cURL
  4. In the terminal, paste this, and either remove the gzip line or pipe through gzip, do this for each page, e.g.:
curl 'https://api.koinly.io/api/transactions?page=1&per_page=20' \
    -XGET \
    -H 'Accept: application/json, text/plain, */*' \