Kenton Vizdos

Kenton Vizdos

@kv.codes

Go & Lit (web components) Developer making cool things Technical Blog @ https://go.kv.codes/blog

66 followers234 following308 posts

Needed one change from a feature branch, without dragging the whole branch into main? There is a clean Git move for that. Quick thread on copying a single file across branches, no merge required.

View full thread

After running it, you still control what lands in main. Review the diff, run tests, then commit just that file change.

Takeaway: when you want a targeted update, treat it like a file-level import. Use git restore, keep main clean, and keep the change set small and auditable.

Needed one change from a feature branch, without dragging the whole branch into main? There is a clean Git move for that. Quick thread on copying a single file across branches, no merge required.

View full thread

Git can restore a file from another branch directly into your working tree. No cherry-pick, no merge commit, no rebasing gymnastics.

Command: git restore --source branch_name -- file_path This replaces the file in your current branch with the version from the specified branch.

Needed one change from a feature branch, without dragging the whole branch into main? There is a clean Git move for that. Quick thread on copying a single file across branches, no merge required.

Scenario: you updated a file in a branch, but main only needs to update that one file. Merging the branch would pull unrelated commits, risk conflicts, and expand the review surface.

Go lets you do something that feels illegal: shadow `nil`. Yes, `nil` is not a keyword. It is a predeclared identifier, so you can redefine it in a scope, and the compiler will accept it.

View full thread

Finally: ```go fmt.Println(x, nil) ``` prints something like: `<nil> a` `x` is still the real nil interface value. `nil` is your local string variable. Same token, different binding.

Takeaway: avoid shadowing predeclared identifiers (`nil`, `len`, `new`, `make`). Go allows it, but it creates code that is correct and deeply misleading at the same time.

Go lets you do something that feels illegal: shadow `nil`. Yes, `nil` is not a keyword. It is a predeclared identifier, so you can redefine it in a scope, and the compiler will accept it.

View full thread

So this line: ```go if x == nil ``` is no longer β€œis x nil?”. It is β€œis x equal to the string `a`?”. In other words, it becomes: ```go if x == "a" ```

That comparison is false. `x` is a nil interface value, not a string. So the `panic(nil)` never runs, even though it reads like it should. If it did run, it would panic with `"a"`, because `nil` is your string.

Go lets you do something that feels illegal: shadow `nil`. Yes, `nil` is not a keyword. It is a predeclared identifier, so you can redefine it in a scope, and the compiler will accept it.

In this program: ```go var x any nil := "a" ``` `x` is the zero value for `any`, which is a nil interface value. Then you create a new variable literally named `nil`, holding `"a"`.

After `nil := "a"`, every `nil` in that scope refers to your string variable, not the built-in `nil`. You did not change the language, you just hid the predeclared identifier behind a local name.

Web Share API enables native sharing from the browser, via `navigator.share({ title, text, url, files })`. It returns a promise, so you can log success vs cancel. Implement feature detection and fall back to copy-to-clipboard for unsupported browsers kv.codes/post/Web-Share-API

kv.codesWeb Share APIA quick dive into the Web Share API: how it works, when to use it, and why it's surprisingly useful for modern web apps (especially on mobile). Includes code, fallbacks, and a few UX tips.

linecon was an experience πŸ˜† 8pm-8am eeesh. I’ll probably go in a tad later next year ;)

DEF CON@defcon.bsky.social

As you’ve likely heard, attendees in the cash line are getting paper badges right now. This is due to a badge shipment delay. We’re sorry for the inconvenience and we’ll do our best to make it right. Thanks for your understanding. Stay in touch with DEF CON socials for updates. #defcon #defcon33

TIL about the rabbit hole that is HLS! 🫨

Stephen Robles@stephenrobles.com

I love RSS + Podcasts, and there's a group of people doing everything they can to make sure RSS can support video Thanks to @transistor.fm Primary Tech is now delivering audio AND video in a single feed with open standards. Podcast apps like Fountain will soon support switching media on the fly

Oh Dear.. Why does Selection.getComposedRanges() have MULTIPLE signatures: - Safari: Selection.getComposedRanges(shadowRoot) - Chrome: Selection.getComposedRanges({ shadowRoots: [shadowRoot] }) But hey, now its working in Chrome, Safari (+ iOS), and Firefox! #webcomponents #litjs #webdeveloper

Build circuit breakers into your systems. Any time you have a third party dependency: - A) Try to have a fallback in case Primary goes "offline" - B) Still keep up 100% "usability" in your own app; even if it means queuing tasks for later. It will pay dividends. #software

The one big struggle I've hit with #golang: there are ZERO nice image creation libraries. Generating OG Images is HELL. Node, you've got this one in the bag. (i still struggled through gg)

The HARDEST part about #frontend: When to show a loading state, empty state, and content-ready state. Most solutions are done by time / results shown instantly: decent-enough for most users. But still, I hate it. #typescript

Kenton Vizdos reposted

Moment of Gratitude: CloudFlare CloudFlare saved the Internet Archive servers from a DDOS yesterday. Max rate of this DDOS attack was 525 Gbps (44.93 Mpps) of a "TCP flood" @archive.org does not have enough bandwidth to fend off that kind of attack = wouldbe bad saturday. Thank you #CloudFlare

What's your devx stack look like? Mine is: - PostHog for UA - GitHub Actions for Pipelines - AWS Fargate for Prod Deployments - Cloudflare Pages for frontends - Terraform for IaC #software #developer

What's your favorite hidden gem in #Golang? πŸš€ Whether it's a handy stdlib package, a time-saving tool, or a clever pattern, drop your top Go tips below! Let's help each other code smarter. #golangtips #godev

As a #webdeveloper, what are your plans for iOS 26? Any big changes in mind? I'm just hoping we get a `-apple-blur` effect that makes things feel native (hahah one can dream).

Okay web people.. what are you using for change logs? (e.g. a page for change logs) How automated is it? #software #development #golang #webdev