Here is how a number is divided up...
So how do we identify large numbers?
The "trick" is to always group the digits in threes from right to left, starting with the smallest unit (ones).
Here's how it works:
$ dig www.integralist.co.uk +noall +answer | |
; <<>> DiG 9.10.6 <<>> www.integralist.co.uk +noall +answer | |
;; global options: +cmd | |
www.integralist.co.uk. 14400 IN CNAME dreamy-wing-b0b998.netlify.com. | |
dreamy-wing-b0b998.netlify.com. 120 IN A 3.75.10.80 | |
dreamy-wing-b0b998.netlify.com. 120 IN A 3.125.36.175 | |
$ curl -so /dev/null -D - https://dreamy-wing-b0b998.netlify.com |
echo -ne "Getting the TLS entries from 1Password... ⌛\r" | |
sleep 2 # Simulate some processing | |
echo -ne "Getting the TLS entries from 1Password... ✅\n" | |
# -n prevents echo from automatically adding a newline. | |
# -e enables interpretation of escape sequences like \r (carriage return). | |
# \r moves the cursor back to the start of the line, so the next echo overwrites it. | |
# The final \n ensures the cursor moves to a new line after displaying the ✅. |
Create a new directory for your project.
Inside the directory git clone
your projects.
Next, from within the project directory (where the individual projects are cloned within), create your go.work
file.
You can do this in one of two ways:
go work init ./cli ./go-fastly
# update --cursor value to acquire all the relevant domain data (see batch-identify-domains.sh) | |
fastly domain-v1 list --fqdn=test-tf --cursor=<REDACTED> --limit=100 --json | jq -r .data[].id >> /tmp/delete-domains | |
# now delete all those items | |
cat /tmp/delete-domains | xargs -P "$(sysctl -n hw.ncpu)" -I % fastly domain-v1 delete --domain-id=% |
I don't know if this actually works but apparently you can use a discriminator like this...
Note
In this example, your API has to return a type
property that might have a value like "base"
or "feature_x"
.
If the API response contains "type": "base"
, then the OpenAPI schema will use the BaseResponse
schema.
Otherwise, if it's "type": "feature_x"
, the OpenAPI schema will use the eatureXResponse
schema.
openapi: 3.1.0
# list all accounts | |
op account list | |
# check which account we're using | |
op whoami | |
# switch account | |
op signin | |
op signin --account my # account flag must be passed subset of the URL from `op account list` (e.g. `my` matches `my.1password.com`) |
Tip
For a real-world example see [this gist][real-world].
errgroup.Group
in Go is a great way to manage concurrent goroutines that return errors. It simplifies error handling and ensures that all goroutines finish or exit if any one of them fails. However, there are specific scenarios where it shines and others where it might not be the best fit.
errgroup
helps manage their lifecycle.You need to install Hammerspoon and setup a ~/.hammerspoon/init.lua
.
Examples can be found here: https://www.hammerspoon.org/go/#helloworld