HNHacker News
TopNewBestAskShowJobs

hmsimha

659 karma · joined November 10, 2012

https://www.linkedin.com/in/hartsimha/

https://github.com/harts

https://github.com/hmsimha

submissionscomments
hmsimha··on Prisma – ORM for Node.js and TypeScript
I have mixed feelings about Prisma. I do think it might be the best general-purpose ORM for relational databases in the Node landscape, and support for Typescript with autogenerated interfaces is amazing. But it seems to fall short in some ways as well (my experience with ORMs in the past is limited to ActiveRecord and Mongoose, both of which I haven't touched in years). I've only been using Prisma for ~2 months, for an internal application on which I'm the sole developer, and I'll keep using it. But given a new project and freedom to choose, there's a very good chance I'd go with another ORM depending on the use case.

One of the things that is most perplexing to me is the inability to autogenerate a seed file from existing data, to reseed a new database. This would be incredibly helpful for testing and working with staging data. For example, we have a staging database and staging server, and want to be able to reseed the database with some data set, but don't want to write all the data inserts by hand. I'm sure there are many ways to avoid doing this (db-specific export/import, scripting the inserts in a loop over a collection of arrays of values which you've curated by hand, or in our case just copying the sqlite db file). Still, Prisma's story around seeding and data fixtures in general currently leaves a lot to be desired.

There have also been many rough edges I've run into around shaping results (getting category names which have been applied to all blog posts by a given user, for example), and applying schema changes, but I'm not willing to rule out user error / inexperience for many of these

hmsimha··on Unusual Stock Trading by Whales in US Congress
This conclusion in particular is probably something that I've assumed in the past:

> On a whole, Democrats seem to love tech and Republicans seem to love oil and gas.

But I hadn't really thought about the wide-reaching implications until now; perhaps its more than a coincidence that the current cryptocurrency bull run really took off shortly after Biden won the presidential election.

hmsimha··on Temporal Tables PostgreSQL Extension
I'm currently getting started with TimescaleDB for storing lots of time-series data (all the public data from cryptocurrency exchanges).

Turns out, there's a bit of weird stuff required in order to collect orderbook data, which involves recording updates, but also the 'full state' (or at least as much as I can get) periodically. The current plan is to add an interface between the DB and the consumers that makes it work a bit like a temporal table (if we're storing the full state at the beginning of every hour, the previous state along with any updates should expire at the end of the hour).

If postgres could also leverage the temporal tables extension we might prevent needing to store a lot of entries that 'invalidate' previous entries, but then I imagine there's internal overhead with the temporal tables extension as it manages expiry time.

I'm wondering, are there any notes on using the temporal tables extension with the timescaledb extension? Wondering if that's something worth investigating.

hmsimha··on Commits are snapshots not diffs (2020)
I actually haven't had a problem with this, though perhaps it's because I understand what's happening at a deeper level. You're generally referencing commits which exist somewhere in this family of commits you can view with `git log --graph`. You can easily think of checkout as the path of diffs to get there. Files at commits are still whole objects, mentally, but the thing we care about as programmers working with multiple versions are the diffs.

I have had it break down a bit more when working with stash though, because now the object you're referencing can exist outside of that graph-like commit family.

hmsimha··on Commits are snapshots not diffs (2020)
Those non-programmers are likely going to have a worse understanding of what is happening when you zip/compress something anyway, but I concede this is probably the most straightforward path if they have some understanding of what a zip is, and can't understand what a diff is. But even then I question if they should be using git, since `git diff`, `git show`, basically everything git exposes, is going to show them diffs.
hmsimha··on Commits are snapshots not diffs (2020)
This is the thing though. You're talking about snapshots which actually have duplication removed... in my mind this really fits more with the 'diff' model. I've already done the exploratory diving-into-git-internals thing years ago, so I could develop a better understanding of how things actually work.

But for newcomers who want to understand how git is working, it really makes more sense to tell them it's 'like a diff. Not exactly under the hood, but think of it like a diff for now'. This is what I've been telling people as I've mentored a number of people in getting acquainted with git over the years, and if they're curious enough to look under the hood, they'll get a better understanding of the internals.

As a programmer, what you're working with is essentially the diff. This is the easiest way to think about things initially. The fact that git is storing blobs under the hood, shallowly deduplicating blobs but still storing large chunks separately that may contain duplicate data, until it generates packfiles which do a deeper deduplication/compression, is really not that helpful. Telling people it's more like zipping is a bit disingenuous because it doesn't really explain how things are compressed more efficiently over the course of many changes.

If I have a 1MB code file and make 1000 commits of one-line changes then sure, git is initially storing large blobs representing those, but then will compress over the change set when it generates the packfile.

Compared to making a zip of the file for every change (say these are 100KB compressed) and now you have people thinking the 1000 one-line changes generate 100MB in the .git directory.

You may think that a 1MB file with many smaller changes is a fabricated example, but consider that dependency lockfiles (package-lock.json I'm looking at you) can easily grow to this size, and contain this many changes.

hmsimha··on Signal adds a payments feature with a privacy-focused cryptocurrency
Heads up, it would be useful on HN if you were to disclose your affiliations / interests when posting, especially about something like a cryptocurrency you helped design.

It gives readers a better sense of your ability to answer the questions accurately, in addition to letting people make assessments based on the potential conflict of interest.

Also, responding here and inviting discussion on a technical level is possibly the best thing you can do for perception of Mob, because this is a forum where those questions are likely to get asked.

Edit: I see you've done that in another post on this thread. Since we don't have anything like flair it would also help people who don't read the whole thread.

hmsimha··on Have I Been Facebooked?
The previous thread on this linked the downloads.
hmsimha··on Have I Been Facebooked?
Be aware that this (currently) doesn't work for Canadians (at least the one I checked). You'll have to download the dump yourself and grep.
hmsimha··on sveltejs/kit
My day job is with React, but I had a chance to play around with Sapper a bit recently and was super impressed with how easy it is to use as well the fast load times and how accessible it makes content.

But I was dissuaded from getting too invested by the big sunset notice on Sapper. Sveltekit has been on the horizon for a while now and I've been eagerly awaiting this!

hmsimha··on Why I don't like Tailwind CSS
I haven't actually started using Tailwind yet, but I really disagreed with the first point:

> 1. Tailwind Makes Your Code Difficult to Read

...

> First, like Bootstrap, it’s semantically obscure because all of its class names are awkward abbreviations

...

> I would rather look at some CSS that has padding: 0.25rem or margin: 0.5rem instead of trying to mentally map Tailwind’s p-1 or m-2 to their CSS equivalents.

Please the latter is so much easier for me to read, and can (hopefully) be remapped from rem to px in one place, or to use increments of .5 instead of .25, which avoids manually changing potentially hundreds of selectors. Furthermore, using conventions for these kinds of class names makes the knowledge transferrable to another project without having to relearn/rewrite all of these.

> Another reason why Tailwind is so hard to read is because it requires you to pan your eyes horizontally rather than vertically. ... When you string a bunch of class names together, you get markup that looks like this

  <div
    class="w-16 h-16 rounded text-white bg-black py-1 px-2 m-1 text-sm md:w-32 md:h-32 md:rounded-md md:text-base lg:w-48 lg:h-48 lg:rounded-lg lg:text-lg"
  >
OK, I get that this could be an issue if you're writing markup by hand, but for a large project this seems like a terrible idea. If you're over in JSX-land (or any templating, really), you'd have an array/set for classNames somewhere, and can just join(' ') it. If for some reason you need to have 50 classes, sure, line-separate them. In many (most?) situations you'd want to construct that array/set programmatically anyway, and encapsulate tightly-coupled display logic in smaller building blocks
hmsimha··on I don't want to learn your query language (2018)
I really like this article discussed here recently, which breaks down the new front-end work into front-of-front-end and back-of-front-end: https://news.ycombinator.com/item?id=26160538

knowing html is a somewhat nebulous claim, there are so many elements, attributes, and relationships, and the specification is incredibly dense. A design-focused front-end developer may almost exclusively use parts of HTML that a 'back-of-front-end' developer might not even know exist.

I do think you could do back-of-front-end very competently and have only a vague understanding of HTML. However, you'd likely also be interacting strictly with a subset of React.

hmsimha··on OpenStreetMap charts a controversial new direction
There's a similar problem with websites which map rock climbing routes. Some make their data open to some extent, but not in a way that can be meaningfully contributed back to OSM. Even though they all use OSM data (usually via Mapbox), to generate their maps, and allow users to draw and annotate layers on top of it.

I'm very interested in working towards an open tooling and open data ecosystem for rock climbing information, but I don't know where to get started on finding others to build it with.

hmsimha··on Show HN: Clerk – all of user management as-a-service, not just authentication
> Another consideration: you want the ability to export your users should you want to move services. People who aren't self hosting with FusionAuth can get a database export from us, for example, if they want to migrate.

It's not even worth evaluating at the free tier without this. I asked in their slack and they said they intend to support this, which is promising (though sounds like it's not implemented yet)

hmsimha··on No support Linux hosting shutting down from hack
CVEs for breaking out of a docker container come along as well [1]. Usually you need root in the docker container, but if you combine it with an escalation from non-root to root.. well, you can see how that's less secure than a VM

[1] https://unit42.paloaltonetworks.com/breaking-docker-via-runc...

hmsimha··on Show HN: Clerk – all of user management as-a-service, not just authentication
I can immediately see how this would be useful for prototyping (and growing) a product! But it might be helpful to include a FAQ answering (at least) the following questions:

- Can user information be exported for clients who may want to build out their own solution later? If so, what does that story look like?

- Can account management pages be customized/styled to match the clients' branding?

- What parts, if any, of Clerk are open source? Do you have a github?

- Do free tier users have a grace period to upgrade/migrate if they exceed 5000 MAU, or is user access cut off until they upgrade?

- Where are you located, and are you targeting certain regions/countries for new hires?

Also, the tier pricing is a bit opaque.

The "professional" tier pricing appears to start at $49/month (for <= 1000 MAU) and scale to $4999 (for 100,000 MAU). The "enterprise" tier mentions a volume discount (which would suggest less than $0.05/MAU), but presumably the overall price increases? If that's not the case, why not allow clients to remain on the professional tier if they don't need features exclusive to the enterprise tier?

hmsimha··on A visual guide to SSH tunnels
ProxyJump indeed seems more useful, but has less support (it's a "newer" SSH feature). Do you know if it needs to be supported by the openssh libs of intermediate hosts, or just the initiating client?
hmsimha··on Show HN: Haven – Run a private website to share with only the people you choose
I don't believe Google+ let you self-host, or fully control your data, which seems to be the primary value proposition here. Google+ also wasn't open source, so for example, you couldn't see that deleted posts were actually deleted on the server (they likely weren't)
hmsimha··on A Framework for Writing Better Documentation
FAQs and code comments don't really fall cleanly into any of these categories.
hmsimha··on GoboLinux
Have you audited Tails by any chance?
hmsimha··on Drug decriminalization in Oregon begins today
This amazing Ted talk [1] on the potential for ketamine as a miracle anti-depressant presents at least one reason; namely, that they don't own the patents to the drugs and therefore can't monopolize their production. Instead, iterative waves of SSRIs are pushed to the public, as Big Pharma stands to profit more from SSRIs they hold the patent to, even if they're arguably much less effective and more harmful.

[1] https://www.ted.com/talks/rebecca_brachman_could_a_drug_prev...

hmsimha··on My Third Year as a Solo Developer
Have you considered rebooting "portfolio rebalancer" in light of the recent interest in stocks? I was just thinking earlier today about how handy a tool like this would be, as well as a similar idea for cryptocurrencies where users could deposit some amount of bitcoin and have it spit some diverse portfolio of crypto back at you.
hmsimha··on Apple silicon M1 as-a-Service
> I wonder who precicely this is targeted for. The concept is interesting, but doesn't everyone who develops for macos already have a mac?

Maybe, but is everyone who develops for OSX going to have an M1 in 2021-2022? I just bought a refurbished Intel-based Macbook Air (for just $50 shy of what a new M1 Air would have cost) due to concerns about virtualization software compatibility. People developing software to run on OSX may not want to invest in M1 machines this early, and small-to-midsized companies who rely on their Mac farms to run test suites etc. may not want to duplicate their infrastructure just to validate their software on M1, when they can perhaps meet their needs by using elastic M1 services.

hmsimha··on State of JavaScript 2020
Because you'll just as easily stumble on other packages which are "bleeding edge", highly regarded, and require Node 15 features to run
hmsimha··on Show HN: StaticBackend – A web and mobile back end without lock-in
Looks cool to me. I like the more flexible tiers, not sure why others are suggesting slimming them down.

I assume "unlocking" the backend and getting the source code gets you something in Go then, but I didn't see more information about exactly what you get with that option. What frameworks, technologies, etc. Is the API described in Swagger/OpenAPI? What DB? If I use staticbackend, but then I want to write my own backend, can I export my user DB without paying the $10,000? Does the $10,000 even include the User DB!?

hmsimha··on Vagrant 2.0
Mostly, though the vagrant-libvirt provider is still a separate plugin, and hasn't reached 1.0 yet, probably due to several rough edges.

edit: I should also mention that vagrant-libvirt doesn't even work on Vagrant 2.0.0, due to https://github.com/vagrant-libvirt/vagrant-libvirt/issues/76...

hmsimha··on A Simple Chrome Extension to help you increase your productivity by 10x
Looks interesting, and I've been wanting something like this for a while.

Would it be possible to add an option to whitelist sites that are productive instead of just blacklisting ones that are not?

hmsimha··on PolyConf – Programming conference for polyglot and full stack programmers
Assuming the date displayed on the page, "Jul 7 - Jul 9 2017" is correct, their countdown is off.

  var countdown = new Date(2017, 7, 26, 1).countdown();
should be

  var countdown = new Date(2017, 6, 7, 1).countdown();
hmsimha··on Millennials Flee Vancouver for More Affordable Cities
There are some ballparks on their page at angel.co: https://angel.co/sendwithus

Having interviewed with them a couple of years ago, I can attest that their team is incredibly nice, and the product is interesting also.

hmsimha··on Curl vs. Wget
Curl gets another point for having better SNI support, as wget versions until relatively recently didn't support it.

This means you can't securely download content using relatively recent (but not the newest) versions of wget (such as any in the Ubuntu 12.04 repos) from a server which uses SNI, unless the domain you're requesting happens to be the default for the server.

As an example, I found the file https://redbot.org/static/style.css only accessible with SNI. Try `wget https://redbot.org/static/style.css` vs. `curl -O https://redbot.org/static/style.css` on Ubuntu 12.04. Domain names which point to S3 buckets (and likely other CDNs) will have similar issues.

← PreviousPage 3 of 13Next →