HNHacker News
TopNewBestAskShowJobs

s4i

1,457 karma · joined May 3, 2017

submissionscomments
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/

s4i··on Interactive Music Theory Cheat Sheet
Germans also name the notes differently (C, D, E, F, G, A, H) which has unfortunately spread to some other countries too (like in Finland, which confuses me a lot because I've learnt so much music stuff online that uses the more logical naming).
s4i··on Interactive Music Theory Cheat Sheet
I don't think it was me but maybe it was another page someone else shared from this cool site? Please share what it was if it's relevant.
s4i··on How to store your app's entire state in the url
Yup. Session storage is particularly useful for remembering the initial URL of the user when they leave your app for SSO.
s4i··on Microsoft.Recognizers.Text: numbers, units, and date/time in multiple languages
Can someone be awesome and ELI5 this? Not sure if I'm dumb or the people behind this have a very focused target audience in mind.
s4i··on We chose NanoIDs for PlanetScale’s API
I assume you mean internal IDs == primary keys in your database. If that's the case, and if your primary keys are UUIDv4's, ULIDs, KSUIDs, Cuids or similar... then why not? There are a lot of benefits, such as simpler SQL queries in your backend. You can also merge data from different databases into one as collissions are highly unlikely, which is not possible with numeric IDs.
s4i··on Moving the Ctrl Key
What software do you use to make this work? What OS?
s4i··on Lesser-known JavaScript APIs
I used this to more easily share links to HN when I'm on the phone (only works on Android for now though). [1]

[1] https://samulisuomi.github.io/share-to-hn-pwa/

s4i··on Accidental Google Pixel Lock Screen Bypass
Applies to YouTube too.
s4i··on Idiot Proof Git
It would be great if GitHub (not sure about GitLab, Gitea, etc) included the title and the description of the PR (maybe up to a certain character limit) in the merge commit when you merge the PR. This would be at least a minimal level of backup for the PRs but it would also prevent common scenario for me where I need to switch to the browser from `git log` just to remind what the heck this one PR was about again.
s4i··on The benefits of “low tech” user interfaces
Reminds me of modern stoves. All of them have touch controls which means every time a friend of mine is presenting me their new kitchen, I have no idea how to use the stove. They always say "No, no, it's really easy to get used to" but it's still frustrating because the touch controls never bring any new features to the table. They are just knobs abstracted into separated buttons and sliders, of which the latter you are not quite sure if you should drag them or just point to the wanted value. With a physical knob, the intuition of the laws of physics tells you how the knob can be turned.

They are easier to clean for sure but I can't believe the current "click this, slide that" UX is the best the manufacturers could come up with.

s4i··on A simple system I’m using to stay in touch with hundreds of people
Explicitly dividing people into groups of decreasing priority is the one thing that feels the most uncomfortable. But I also understand there is an implicit hierarchy in your head anyway.

We've started planning a wedding recently and started drafting a guest list, which basically means making that hierarchy explicit on a spreadsheet (to filter out guests), only for two people at once instead. To my brain, which always wants to please everybody, it's a painful process.

s4i··on Pico CSS Framework
You could namespace the Pico styles using SASS. Basically like [1] but you'd extend it to be e.g.

  .pico-enabled *:not(.piko-disabled) {
    @import "layout/document"
    @import "layout/sectioning"
    @import "layout/container"
    ...
Then you can do this:

  <div class="piko-enabled">
    ...
    <button>A button with Piko styling</button>
    <div class="piko-disabled">
      <button>A vanilla browser button</button>
      ... and any 3rd party components/elements etc ...
[1] https://github.com/picocss/pico/issues/31#issuecomment-91399...
s4i··on Stacked changes: how FB and Google engineers stay unblocked and ship faster
> You absolutely can merge a single commit, via git push, there's just no button in the GitHub UI for it.

Well, I'm asuming we are talking about PRs against some protected branch where manually pushing changes directly is forbidden.

s4i··on Stacked changes: how FB and Google engineers stay unblocked and ship faster
But, when using GitHub, isn't the missing puzzle piece here (which Graphite and other "stacked review tools" mentioned here attempt to solve) that you then cannot just merge those individual PRs one by one – you either have to merge the whole PR or nothing? Which leads us to the second option: to use multiple dependent PRs, which causes its own issues explained in other comments.
s4i··on Show HN: Obsidian for Mobile – Plain-text knowledge base on the go
I think this is the episode you are reffering to? https://www.relay.fm/cortex/105
← PreviousPage 4 of 4