Export 28degress master card transactions to CSV
- Visit 28 degress transactions page
- Open Developer Console
- Paste code
- Press enter
| import defaults from "lodash.defaults"; | |
| let httpBtn = { | |
| bind: (el, binding) => { | |
| //get options (evald expression) | |
| let opts = binding.value; | |
| if (typeof opts === "function") { | |
| opts = {fn: opts}; | |
| } | |
| //provide defaults |
| //scale returns the number scaled to its corresponding SI suffix. | |
| // scale(1234) => "1.2 K" | |
| //MIT License, Copyright jpillora © 2019 | |
| function scale(n, d) { | |
| // set default number | |
| if (typeof n !== "number" || isNaN(n)) n = 0; | |
| if (n === 0) return "0"; | |
| // set default digit count | |
| if (typeof d !== "number" || isNaN(d)) d = 1; | |
| // find scale index 1000,100000,... becomes 1,2,... |
| #!/bin/bash | |
| # given "https://www.icloud.com/iclouddrive/<ID>#<Filename> | |
| ID="...." | |
| URL=$(curl 'https://ckdatabasews.icloud.com/database/1/com.apple.cloudkit/production/public/records/resolve' \ | |
| --data-raw '{"shortGUIDs":[{"value":"$ID"}]}' --compressed \ | |
| jq -r '.results[0].rootRecord.fields.fileContent.value.downloadURL') | |
| curl "$URL" -o myfile.ext |
| import { useCallback, useEffect, useState } from 'react' | |
| // borrowed from https://usehooks.com/useAsync/ | |
| export function useAsync<T>(asyncFunction: () => Promise<T>, immediate = true) { | |
| const [loading, setLoading] = useState(true) | |
| const [value, setValue] = useState<T | null>(null) | |
| const [error, setError] = useState<any>(null) | |
| // The execute function wraps asyncFunction and | |
| // handles setting state for pending, value, and error. | |
| // useCallback ensures the below useEffect is not called |
| func typeCache[T any](compute func(t reflect.Type) T) func(t reflect.Type) T { | |
| cache := map[reflect.Type]T{} | |
| return func(t reflect.Type) T { | |
| if v, ok := cache[t]; ok { | |
| return v | |
| } | |
| v := compute(t) // but compute cant recurse | |
| cache[t] = v | |
| return v | |
| } |
Setup
npx create-vite
# vanilla
# typescript
# enter name
cd name/
npm install reveal.jsSetup multipass https://multipass.run/
Setup XQuartz https://www.xquartz.org/
Run ubuntu and connect over ssh
Setup mininet http://mininet.org/ with sudo apt install mininet
Open one tab with Wireshark, using ssh -X ubuntu@<ip> sudo -E wireshark
go install -v tailscale.com/cmd/tailscale{,d}@latest
sudo tailscaled install-system-daemon
tailscale up
# login, approve
tailscale status