-
Resizing And Centering the Canvas Of a Godot Web Export
The project and export settings you will need in order to center the canvas of a Godot web export, and resize it to fit the browser window. Continue reading →
-
Another thing I learnt about PostgreSQL: notifications sent within a transaction will only be dispatch to listeners until and unless the transaction is committed. So inserting rows in one transaction, and notifying something which will consume those rows in another should not result in a deadlock.
-
TIL about socat, a Unix command that can be used to create bi-directional TCP proxies, much like
ssh -L. Example (via), forward traffic from local port 8080 to example.com port 5545:socat tcp-l:8080,fork,reuseaddr tcp:example.com:5545Useful for setting up ad-hoc proxies to a Kubernetes cluster to access resources only available to the cluster itself. Launch
socatusingkubectx runwith a port set in the cluster:kubectl run --rm -it --port 8080 --image alpine \ --overrides='{"metadata":{"name":"my-proxy"}}' \ sh -- sh -c 'apk add socat && socat tcp-l:8080,fork,reuseaddr tcp:backend.example.com:5545'Then, setup a port forward to your pod to access the port locally:
kubectl port-forward pod/my-proxy 8080:8080With this, you can now access
backend.example.com:5545on localhost port 8080. -
Small TIL about Zed: if you have something selected, and you hold down the Option key, you can spawn a new cursor and selection region. Useful for renaming things that are not identifiers: select one, then Option+Double Click to select other instances, then simply type in the new name.
-
The recent version of Zed changed the caret movements of ⌥← and ⌥→ from one based on word boundaries to one based on sub-word boundaries, like when a case change occurs. If your caret was on the left of an identifier like
MyFancyIdentifier, when you pressed ⌥→, instead of going to the end of the word, it’s moved to the front of “Fancy” since it detected a case change.It’s a style of navigation I don’t care for. Fortunately, you can turn it off by opening
keymap.jsonand adding the following:// keymap.json [ { "unbind": { // -- Snip -- "alt-left": "editor::MoveToPreviousSubwordStart", "alt-right": "editor::MoveToNextSubwordEnd", "shift-alt-left": "editor::SelectToPreviousSubwordStart", "shift-alt-right": "editor::SelectToNextSubwordEnd", // -- Snip -- } } ] -
Deployed a PostgreSQL database migration with some new nullable columns:
ALTER TABLE example ADD COLUMN thing TEXT;The table has 100,000,000s of rows, so I was expecting the migration to take a few minutes. Instead, it was so fast I thought it wasn’t applied at all. PostgreSQL frickin’ rocks!
-
For anyone else using Hugo that would like to use files in the
staticdirectory as resources, to do things like produce images thumbnails, you can “mount” the static directory within the resource directory using Hugo modules. This blog post documents how. Did it myself and it worked a treat. -
Working Around One-Shot GPUParticles2D Emitter Slowdown
A technique for preventing the awkward slowdown when a one-shot GPUParticles2D emitter is fired for the first time in Godot. Continue reading →
-
Had to do some changes to NATS streams and consumers today, and learnt a few things from doing so.
First, it is possible to change the subject filters of a NATS consumer while it’s being used. That is, a client could be using it to pull messages, and it doesn’t need to reconnect or anything to get the effect of the consumer change. It will continue to receive messages, so long as they match the new subject filter.
Second, if you’re using the NATS CLI to change the filter, in order to specify multiple subject filters, include multiple
--filterswitches:$ dc-nats consumer edit \ --filter='topic.one' \ --filter='topic.two' \ --filter='topic.reset.>' my-stream my-consumerSpecifying a single
--filtervalue with subjects separated by commas will not work. I’m not entirely sure what will happen but I suspect that it will create a subject filter that includes the commas in some way. -
I’m not sure if I’m the only one that experiences this but SSH on MacOS seems to have awful keep-alive out of the box. Connections constantly hang when I look away for more than a few minutes. So I can recommend this change in your SSH config:
# /etc/ssh/ssh_config Host * ServerAliveInterval 30 -
The Stripe CLI doesn’t have a command for listing account tax IDs, but it’s still possible to list them using the
getsubcommand. For anyone else that needs it, here’s how you can list them:stripe get /v1/tax_idsAnd to get a single tax ID:
stripe get /v1/tax_ids/txi_abc123 -
TIAL that
sleepis actually not available on the Distroless Docker images, at least from what I can see from Stack Overflow. So if you’re going to use Pod Lifecycle events to wait for requests to finish up, you’ll need some other means of sleeping.