this is so cool
haptics.lochie.me
Instead, create a browser extension thatβll show OTP codes sent to emails :-)
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.
After running it, you still control what lands in main. Review the diff, run tests, then commit just that file change.
Command:
git restore --source branch_name -- file_path
This replaces the file in your current branch with the version from the specified branch.
Git can restore a file from another branch directly into your working tree. No cherry-pick, no merge commit, no rebasing gymnastics.
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.
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.
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.
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.
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.
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"
```
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.
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"`.
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.
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
Masonry Layout is now grid-lanes css-tricks.com/masonry-layo...
π₯π₯π₯
%q is game changer in very unique situations
real
I saw youβre post on self hosting Reddit, seems to have done well!! Congrats!
oh HECK YEAH
welcome to the dark side π
Iβd guess itβs people asking βwhatβs Bruno?β when they see it π
0 OpenAPI and a few comments π«‘
Just refreshed the whoami.filippo.io database.
If you are one of the βlucky 10,000β whoβs never heard of it, try
$ ssh whoami.filippo.io
linecon was an experience π
8pm-8am eeesh. Iβll probably go in a tad later next year ;)
try out just files next!
make has a ton of useful stuff for detecting build changes, but with go, itβs not *as* big of a concern, so more simplistic justfiles work really well imo
Base64 encoding is everywhere on the web: in HTTP headers, JWTs, even in HTML. But what is it and how does it actually work?
I break it down in my latest video!
Watch now: youtu.be/8v4moossLXo
Charge for an API Key.
Devs can scrape, at least an API key you can track usage and charge appropriately π