HNHacker News
TopNewBestAskShowJobs

devnull3

823 karma · joined August 2, 2021

submissionscomments
devnull3··on I switched from Htmx to Datastar
A lot of PRO plugins can be self developed. An example: there is a poor-man's inspector plugin at [1].

The replace-url thing should be a simple JS code using history API no?

[1] https://github.com/sudeep9/datastar-plugins?tab=readme-ov-fi...

devnull3··on UUIDv47: Store UUIDv7 in DB, emit UUIDv4 outside (SipHash-masked timestamp)
Why not use a different encryption key per session and stamp encrypted ids (or whatever info) to the outside word.

This way the DBs can use simple sequence numbers instead of timestamp based IDs.

devnull3··on Just Use HTML
I am backend dev and dipping my toes in frontend dev for my side hustle.

It is a typical CRUD app (like most of them). I like the idea behind HTMX or datastar. I built a prototype in it as well. But then I pivoted to solidjs.

Some reasons for this:

1. Single backend API for web, mobile and any other platform

2. Some UI patterns which are suited for JSON REST APIs [#patterns]

3. Ability to support partial functionality offline.

#patterns

1. Showing a subset of columns in a table but have an option to view & edit each record in detail. In my case a dialog opens with editable checkbox. So it doubles-up as "view" and "edit". These actions render just another view of existing data. A round-trip to server is not desirable IMO.

2. Filtering, sorting on columns. HTML based solution becomes tedious if some of the cells are not plain text but instead a complex component like a <div>. Sorting json and rendering is much better experience IMO.

Edit: About solidjs & datastar

1. It has fine-grained reactivity which I find it appealing and it uses signals which hopefully will be standardized.

2. The compiled bundle size is much smaller than I expected. I have 24KB compressed js which is serves quite a lot of views, pages.

3. Datastar is amazing and I have added it in my toolbox.

devnull3··on The Rise and Fall of Music Ringtones: A Statistical Analysis
There was a time when my main aim of a choosing a certain ringtone was to appear edgy and cool ... and how annoying and wrong was I!

A sample of bad ringtone (auto-tuned baby crying) which was trending back then (2007-2008) was [1]. Thankfully I never used it.

[1] https://www.youtube.com/watch?v=SVvFRzMWdL8

devnull3··on Windows XP Professional
For me the look and feel of Win XP was breath of fresh air compared to Windows 98. WinXP was more user friendly and I was not a power user back then.
devnull3··on Windows XP Professional
Win XP remains my favourite OS till date. I was in college and getting hands on a pirated copy back then makes me so nostalgic.

There was a cambrian explosion of tools to customize the look and feel. TweakXP pro is the one I remember. All pirated off-course.

devnull3··on HTMX is hard, so let's get it right
> He just put the sessionId in the form data instead of a cookie.

This does not have the benefit of being usable across different tabs or even closing and re-opening the page. Besides, (a minor point) shoving all the state in the cookie makes code simple i.e. don't have use URL params.

devnull3··on HTMX is hard, so let's get it right
Not really. DS v1.0 has HTMX like request/response option as well.

You might need async if there are lot of concurrent users and each of them using long duration SSE. However, this is not DS specific.

devnull3··on HTMX is hard, so let's get it right
Cookie is what we make of it. For browser, its opaque data anyway.

So, when /upload is requested, the backend in response sets a cookie with a random uploadId (+ TTL). At the backend, we tie sessionId and uploadId.

With every step which is called, we verify sessionId and uploadId along with additional state which is stored.

This means even if the form is opened on a different tab, it will work well.

devnull3··on HTMX is hard, so let's get it right
With DS (and HTMX) the backend is the source of truth. In the context of the blog post, the state will be made-up of: step no, file content, file path, etc. This can be stored against the session ID in a database.

So when opened on a different tab, the backend would do authentication and render the page depending on the store state.

In general, the backend must always compare the incoming state/request with stored state. E.g the current step is step 2 but the client can forces it to go to step 4 by manipulating the URL.

DS v1.0 now supports non-SSE (i.e. simple request/response interaction as well) [1]. This is done by setting appropriate content-type header.

[1] https://data-star.dev/reference/actions#response-handling

devnull3··on HTMX is hard, so let's get it right
In DS, with SSE you can paint different parts of the page with ease. So in this case, it can update <form> and <label> separately. So instead of one update the backend fires 2. There is not separate marker or indicator for OOB.

I think it is best seen in examples on DS website.

devnull3··on HTMX is hard, so let's get it right
> Challenge 2: Passing data down each step

Why not use cookies?

devnull3··on HTMX is hard, so let's get it right
This should be trivial with the HTMX alternative: datastar [1]

In datastar the "Out Of Band" updates is a first class notion.

[1] https://data-star.dev

devnull3··on Introduction to Indian English
One of the recent inventions I like: Presstitute

Its a combo of "Press" and "Prostitute" and it aptly describes some journalists and media people who clearly take sides and have sold their souls.

devnull3··on Introduction to Indian English
This does not talk about the numbering system. See [1]

"Lakh" => 100K

"Crore" => 100Lakhs

[1] https://en.wikipedia.org/wiki/Indian_English#Numbering_syste...

devnull3··on Introduction to Indian English
Another one: updation

https://www.oed.com/dictionary/updation_n

devnull3··on Introduction to Indian English
Prepone is now a word in Cambridge dictionary [1]. It acknowledges the origin to India.

[1] https://dictionary.cambridge.org/dictionary/english/prepone

devnull3··on Ask HN: How commonly is PIP deployed for non performance reasons in FANGs
The irony is that these companies will make you sign & enrol trainings for "code-of-ethics" and the same management will indulge into shady practices (like the OP mentioned). Btw, there are other ways to get rid of employees which do not even need PIP.

I have made peace with the fact employees are just means to an end. Always have been. Nothing less or nothing more. The power is extremely lopsided in favour of the companies. This makes so many things beyond the control of an individual [1]. Focus on things in your control:

1. Keep learning

2. Be debt free as soon as possible.

3. Invest and build a financial cushion

4. Eat healthy and exercise (I am pretty bad at this but trying to improve)

5. Develop an alternative skill(s) which can you put to use if needed

6. Never burn the bridges, no matter what.

All of the above are easier said than done but I see no sustainable way of coping up.

[1] My current employer (which is a listed company) got acquired by a private equity. I have no idea what will happen but I am relaxed.

devnull3··on Fossify – A suite of open-source, ad-free apps
Is there any list of games with same focus on being ad-free? Does not have to be free.
devnull3··on I learnt the Infinite Sum Game in SF from India (and I can't stop playing)
The behavior attributed to Indians in the article is universal. Admission to few college seats is a zero sum game anywhere in the world.

In SF, see if companies share knowledge if they are after the securing a contract from the same B2B customer.

In UK, drivers give way as a courtesy many times even though one has the priority. In return the other driver thanks using hand gestures. However, there was a local football match on a weekend and parking was very hard to find. Parking spots are zero-sum game. People started violating many rules. People started driving against the arrows on the road in desperation to grab the spot. Parking in places which were not marked as parking spots. All the manners & niceties went out of the window. It has hunger-games for parking spots.

BTW, google (and other big companies) hiring top graduates and researchers to deprive others of the same talent is hoarding.

devnull3··on The Coleco Adam Computer
Fun fact: The computer in simpsons is a coleco [1].

On an unrelated note, the short clip is funny as well.

[1] https://youtu.be/av4lbel9aIo?t=7

devnull3··on Show HN: Every problem and solution in Beyond Cracking the Coding Interview
I may have a outdated notion about the trades you mentioned, but I have seen an "apprentice" model a lot. I have seen it with a masonry where the experienced guy was bringing in his nephew and teaching him on the job. A lot of these trades are family owned and have seen taking in people based on someone vouching for the new guy.

Maybe this varies country to country. I have seen this in India and UK atleast.

In UK atleast there are trades like roofing, landscaping, exterior building cleaning, masonry, tree surgeon etc which I have seen them are mostly family based.

devnull3··on Show HN: Every problem and solution in Beyond Cracking the Coding Interview
Males are under pressure to "sustain" it for 10-15 min atleast (with many people watching). For females, no such thing.
devnull3··on Show HN: Every problem and solution in Beyond Cracking the Coding Interview
I wonder which other professions or trade ask people to perform infront of them in a simulated env as a filter criteria.

Actors for sure with auditions and maybe maybe chefs, male pornstars.

devnull3··on Show HN: One Billion Checkboxes
Amazing! This nicely demonstrates capabilities of datastar.

I suggest to put a comment on the page to open dev tools and see the SSE event in action. I think people will appreciate D* even more.

devnull3··on Show HN: One Billion Checkboxes
If I have to guess the tuning and optimizations:

SQLITE:

1. Smaller page size (to be specific: max(disk_sector_size, 512))

2. Integer primary keys

3. WAL mode

4. Increase page cache size. This is assuming that most people will click in the top-left 100x100 checkboxes.

Other optimzation:

1. In mem cache of bitmap of 1B bits, which is about 120MB, which is a shared state for all incoming connections.

devnull3··on We fell out of love with Next.js and back in love with Ruby on Rails
Barring the interactivity SPAs will also end up talking to server anyway. So even SPAs will feel sluggish in a high latency env.
devnull3··on Performance optimization is hard because it's fundamentally a brute-force task
I think optimization triggers fundamental instincts in humans:

1. Tracking i.e. navigating through jungles for hunting or find where the bottleneck is.

2. The thrill of the hunt. The joy after finding the hotspot or the bottleneck. It makes your day.

3. The actual hunt i.e. shooting an arrow/spear or using clever way of fixing.

4. Brag about the hunt or writing a blog post or tech talk on how difficult and awesome the hunt was.

Also optimizing a critical path has multiple takers in the org:

1. Product Managers are happy due to improved user experience.

2. Management is happy as in some cases it actually saves a lot of money.

3. Your boss is happy because he/she gets to score points as "team achievement" when evaluation is around the corner.

4. Engineers get to do nerdy things which otherwise would not find traction in the org.

All in all its a win-win-win-* situation.

devnull3··on Shardines: SQLite3 Database-per-Tenant with ActiveRecord
Shouldn't the service daemon upgrade schema and perform migrations on initialisation?

Before performing upgrade make a copy of the db file. Also multiple DBs can be inited in parallel.

I fail to see why this might be so hard.

devnull3··on The coming knowledge-work supply-chain crisis
> hypervigilant

If a tech works 80% of the time, then I know that I need to be vigilant and I will review the output. The entire team structure is aware of this. There will be processes to offset this 20%.

The problem is that when the AI becomes > 95% accurate (if at all) then humans will become complacent and the checks and balances will be ineffective.

← PreviousPage 2 of 9Next →