HNHacker News
TopNewBestAskShowJobs

s4i

1,447 karma · joined May 3, 2017

submissionscomments
s4i··on SafeTest: A novel approach to front end testing
Needing to change the application code to mock things rubs me the wrong way. I 100% do agree with the frontend testing challenges they lay out in the beginning of the post though.
s4i··on UUID v7
Thank you!
s4i··on UUID v7
Can someone ELI5 what that "UUID v7 support" actually means in the title?

I don't know how to navigate commitfest (nor would I probably understand the source code to begin with), but the reason I'm confused is that you can already use all the proposed draft UUID implementations in Postgres (as long as you generate the ID application-side). In fact, PG will happily accept any 128 bit ID to be inserted into a UUID column, as long as it's hex encoded – even the dashes are optional.

s4i··on Show HN: Startup funding simulator
history.replaceState (instead of history.pushState) is your friend.
s4i··on Four Team Types
Can one person belong to multiple teams at once though?

A person being both in a Stream-Aligned Team and an Enabling Team at once would kinda turn the latter into a ”guild” in the Spotify [1] lingo.

[1] https://www.atlassian.com/agile/agile-at-scale/spotify

s4i··on To metronome or not
I assumed they just work without any explicit tempo set in the DAW. They can mute/unmute the click tracks when recording new parts depending on if the musician needs to hear the count-ins.
s4i··on DeskHop – Fast Desktop Switching
And left and right 5 secs.
s4i··on How to unit test code that depends on time
A big blind spot in Jest (and I assume in Vitest although I have no experience) are the timezones. It’s very tricky to run the tests in other TZ’s than what Node has been started with.
s4i··on JavaScript: Double Bitwise Not (~~) (2010)
Well, surely that comparison is a bit unfair. :) In my books, using `~~` is closer to shit like abusing `[]+[]` to get an empty string, than using `&&` which is its own separate, widely used operator in the language.

You could maybe compare `~~` to something like `if (!someString)` but, again, that's a widely used and way more easily understood pattern.

s4i··on JavaScript: Double Bitwise Not (~~) (2010)
> it’s faster and takes up less characters. It’s not quite as readable though, but I’m hoping that ~~ will slowly become a very well-known technique in the JS arena, so we can all use it without fearing accusations.

Yeah, no thanks. I'll take well named functions over these kind of syntax tricks any day.

s4i··on My toddler loves planes, so I built her a radar
> But, in order to make sure she could handle the 3-hour flight, my wife and I made sure to hype up the airplane journey. So much so, that my toddler was shocked when we had to get into a cab for the airport — she expected to walk straight from our house onto a plane.

This is absolutely adorable, hilarious and understandable at the same time.

s4i··on Sqids – Generate short unique IDs from numbers
Unless we are talking about very long numbers, surely the numbers are easier for people to deal with, say over the phone, etc?
s4i··on Sqids – Generate short unique IDs from numbers
If the original numeric ID can be figured out from the sqid string, then what’s the point of the conversion?
s4i··on Sqids – Generate short unique IDs from numbers
Encoding the UUID in e.g. base 64 or Crockford’s base 32 (instead of the standard hex+dashes) saves you some space.
s4i··on Remove Half of Your Documentation
In the context of this article, I think Copilot is a big contributor in useless comments. If you have already written a block of code, and then go back and start writing a comment for it, the suggestion is almost always a naive and useless repetition of what’s happening directly before, much like the ”# create a user” example given in the article.

I wish the comment suggestions could be disabled completely in the VSCode extension but it’s currently not possible: https://github.com/orgs/community/discussions/8062

s4i··on Tell HN: Please stop sending AI-generated job applications (whoishiring threads)
It was all pretty good until "Remember".
s4i··on Glove80 Ergonomic Keyboard
For an easier learning curve, consider a regular 75% layout split in two. The only keyboard I know of that uses this is Mistel Barocco MD770, which I’ve been using for two years. I’ve swapped the keycaps to DSA ones.
s4i··on Enhance – HTML-first full stack web framework
> SSR composable HTML Custom Elements

I assume that by default all that JS runs on the server and HTML gets returned to the browser.

s4i··on Apple Vision Pro developer kit
That is not why Betamax failed. There was porn on beta. Betamax failed because the cassettes didn’t hold as much tape as VHS and JVC’s licensing model for recorders was cheaper and more straightforward than Sony’s. In the rental market, the format with slightly less friction was a bit more popular each year, which sealed the deal by the mid-80s.
s4i··on Decades-long bet on consciousness ends
> I wouldn't be surprised if consciousness ~conscience~ is just an emergent phenomenon resulting from any sufficiently powerful cognitive system

But does a system exist which we would describe as ”cognitive” but not also ”conscious”? To me this definition gets nowhere.

s4i··on Popover API
A polyfill for orher browsers seems to be available: https://github.com/oddbird/popover-polyfill
s4i··on Winamp Clone Whips the Llama's Ass on an Espressif ESP32
Seems like that's a scam? "It has been brought to my notice that my artwork has been misappropriated and used to deceive individuals into believing that they can purchase an actual physical device." [1]

[1] https://www.rickgude.nl/work/winamp

s4i··on Rails Cheat Sheet
In my last job I encountered my first Ruby/Rails codebase ever (mostly REST APIs but a few server-rendered views as well). Despite the initial chaotic impression of the codebase (it was a startup after all) with all the Rails magic on top, I really fell in love with the framework after a more experienced Rails dev introduced a few key conventions and helpful libraries to the codebase.

Out of those, I’d at least add the RuboCop [1] linter and the BetterSpecs [2] guidelines to this list. Both eliminated bikeshedding in the team and freed up brainpower to solve actual problems: the first one helps you learn intricacies of Ruby bit by bit right in the IDE and the latter one pushes you to write test in a specific style that’s easy to maintain and trust.

[1] https://github.com/rubocop/rubocop

[2] https://www.betterspecs.org/

s4i··on Trap Street
A natural spot to shout out Map Men on YouTube. [1]

[1] https://youtu.be/DeiATy-FfjI

s4i··on Let's build a Chrome extension that steals as much data as possible
But isn't the scrolling problematic here only because macOS by default hides the scrollbars when there is no traditional mouse connected?
s4i··on Things I want to see in JavaScript and Front end development in 2023
> There’s a lint rule about naming the error parameter in catch “error”, not “err” or “e”. Who cares about this shit???

That is certainly in the less important end of the linting rules spectrum. Nonetheless, conventions like these add up in larger codebases in my experience. The more consistency you have with things that repeat a lot across the code improve readability quite much because the brain is able to do more chunking over time.

Of course this doesn't matter that much when you are learning a language or a framework and only have a couple of files.

s4i··on Choosing a Postgres primary key
In this sequential UUIDs idea, I wonder how big of a deal it is if the prefix part wraps around often? E.g. using a timestamp-based prefix with 2 bytes, if you increase the prefix every 60 seconds, the prefix will be reset every 45 days or so (60 * 1000 * 2^16) according to that README. Does it make sense to fine tune this value based on the use case or what?
s4i··on Choosing a Postgres primary key
If the prefix is incremented for every new ID, you essentially have the same problem as you do with serial: you leak information about the amount of rows in some timeframe.

As the link posted above mentions, you can alternatively use a timestamp-based prefix that wraps around after all the bits have been used. This one still leaks possible creation times of the record, so it's on par or better compared to UUIdv6, ULID, etc. (because here the exact creation time can't necessarily be deduced).

In all of these UUID solutions apart from the fully random v4, you are trading of the better index performance with some level of information leakage about the record the ID is associated with.

s4i··on Interactive Music Theory Cheat Sheet
A fair point. I was searching for an "interactive music theory cheat sheet" on Google the other day to see what's around, and I landed on this. It was really good and I played with the page for a while. I didn't realize until after submitting that the whole domain is full of awesome stuff.
s4i··on Interactive Music Theory Cheat Sheet
> a rootless C maj 7 is equivalent to an E min 7.

You mean just the regular E minor (triad)?

Anyway, there'a quite a lot of stuff on this site apart from this cheat sheet page: the chord page does indeed include inversions, e.g.: https://muted.io/c-major-chord/

← PreviousPage 3 of 4Next →