HNHacker News
TopNewBestAskShowJobs

18nleung

515 karma · joined July 6, 2015

natecation.com

my public key: https://keybase.io/nathanleung; my proof: https://keybase.io/nathanleung/sigs/21RQELlB81U9ezo98QC5Ypm7DXkaUdVo--fOyCR9Gws

submissionscomments
18nleung··on Using Terraform in *Local* Dev for Reproducible, High-Fidelity Dev Environments
Author here. Wrote a bit about how we use Terraform for local dev at work. In brief:

Our Docker Compose local dev setup started to break down once we had to model more complicated production behavior locally – things like table-specific Postgres roles for audit logs and dynamically provisioned databases per-clinical-trial. We were drifting toward a bespoke Bash mess to keep dev and prod in sync.

Our core idea was instead to embrace Terraform in the local dev environment too. We were already using Terraform heavily in prod, and Terraform's robust provider ecosystem meant that we could e.g. substitute Docker containers for RDS and MinIO for S3 without deviating too far from our production configuration.

The really fun part is how we use Terraform to handle dynamic provisioning, which we need for isolated, per-clinical-trial databases. The way we do it in prod is by giving each clinical trial its own, isolated Terraform state, stored in a cloud storage bucket. By writing an equivalent local Terraform config for this provisioning step, we enable the app to run the same `terraform apply` command as it does in prod to locally to spin up a new database, with the individual state for that new db stored in a local MinIO bucket... which is itself created by the original `terraform apply` that sets up the initial local dev infrastructure.

Altogether, Terraform gives us a super high-fidelity local environment that lets us test complex application behavior and infrastructure logic without the full overhead of spinning up a local k8s cluster (which is what I imagine the next best alternative might be?). It's readable, declarative, and required no new tooling on our side since we were already using Docker and Terraform anyways.

Curious to hear how other folks are managing complex local dev setups, especially if you're not on Kubernetes!

18nleung··on Show HN: Zero-codegen, no-compile TypeScript type inference from Protobufs
I would have written a shorter source, but I did not have the time.
18nleung··on Show HN: Zero-codegen, no-compile TypeScript type inference from Protobufs
You're right that IDE/dev-time performance might be slower than using generated types since this relies on "dynamic" TypeScript inference rather than static codegen'd types.

That said, depending on how your codegen works and how you're using protos at runtime, this approach might actually be faster at runtime. Types are stripped at compile-time and there’s no generated class or constructor logic — in the compiled output, you're left with plain JS objects which potentially avoids the serialization or class overhead that some proto codegen tools introduce.

(FWIW, type inference in VSCode seemed reasonably fast with the toy examples I was playing with)

18nleung··on How to bike across the country
I biked with the author from SF to Sacramento — we went up to Marin over GGB, then over the Richmond–San Rafael bridge to the EB
18nleung··on U.S. Inflation Accelerates to 40-Year High
How does this work? (I thought volatility mainly affected the value of options, not the underlying cash flows?)
18nleung··on Poop Map Removed from App Store Charts
Thank you, Nino, for a great app!
18nleung··on [dead]
This is a great idea! I learned how to code (+ infrastructure, AWS, HTTP, and a bunch of other stuff) entirely through personal projects.
18nleung··on Building Uber’s Go Monorepo with Bazel
I interned at a FAANG last summer (Google) and I was blown away at how good the in-house tooling was (including the in-house IDE).

Everything was seamless - I'd log in, tap my security key, and instantly have access to pretty much the entire monorepo and the rest of the production + deploy systems. All of the internal tools integrated with each other -- for instance, I could create a CL (i.e. a pull request) and then fix issues raised by the CI system, entirely from the IDE.

"Owning the stack" completely in-house also extended to hardware -- all of my builds happened inside Google datacenters too (not on my machine), and the development box they provided me was a Chromebook.

18nleung··on Building Uber’s Go Monorepo with Bazel
Yes - Bazel has excellent protobuf integration compared to other build tools (we were originally using Gradle). We're compiling Kotlin to the JVM, so the build chain is similar to Java's.
18nleung··on Building Uber’s Go Monorepo with Bazel
We're not at the scale of Uber yet, but at Jupiter (YC S19) we're using tech like Bazel, protos, and Kotlin to prepare us for when we are: https://starship.jupiter.co/jupiter-stack/

We're actively hiring for a senior SWE right now, so feel free to shoot me a note if you're looking.

18nleung··on Eloquent JavaScript 3rd Edition (2018)
I learned JS with this book back when it was ES5 - looks like the new edition is updated for ES6
18nleung··on Stripe CLI
How can I get the multiple terminals view in the blog header image?
18nleung··on A Gazillion-Dollar Standoff over Two High-Frequency Trading Towers
It’s most commonly justified in terms of “liquidity” - allowing orders to be filled at as close to “perfect” market prices as possible
18nleung··on Reflecting on My Failure to Build a Billion-Dollar Company
I'm probably at the tail end of the generation that grew up with Flash games and I have to say Kongregate was great! I loved playing Warlords: Call to Arms. Thanks for your work.
18nleung··on Show HN: Stock Trading with Insomnia REST Client and Alpaca API
Try an iron condor - you’ll profit if the price of the underlying asset stays between two points
18nleung··on Yes, You Can Put a Price on a T-Rex (2015)
There's a reason why the U.S. government doesn't pay ransom money to terrorists - it would set a dangerous precedent.

While this doesn't necessarily have the same dire consequences, it's a shame that the door has been opened to scientific finds being co-opted for money.

I'll always look up to Jonas Salk, who refused to patent the polio vaccine. Some things shouldn't have a price put on them.

18nleung··on The 10:1 rule of writing and programming
Just read Brikman's Terraform book and it was great! He's a clear writer and great explainer and I'd recommend it to anyone looking for a good resource to get started with infrastructure-as-code.
18nleung··on AWS icon quiz
I agree with both points.
18nleung··on Deriving the Y Combinator in JavaScript
Hi! Author here, and glad to see my writeup on HN.

I’m a JS developer by trade, but I’ve recently started exploring FP/Haskell and came across the Y Combinator. The Y writeups currently online that I read were wonderful for a seasoned Haskell programmer, but I thought it would be great to explore the concept from a more FP beginner-friendly lens, and through a more familiar language - JavaScript.

I hope this exploration is helpful, and feel free to leave any questions or comments you may have below!

18nleung··on Show HN: Point your repos to their new home
Most orgs like having a single source of truth for their projects, though (for instance, the Linux kernel GitHub repo is simply a mirror). In fact, if anything, this project could set up mirroring so repos are mirrored from GitLab to GitHub, etc.
18nleung··on Ask HN: Why have I received a lot of Privacy Policy updates
Yesterday, a sweeping new EU privacy regulation called the GDPR (General Data Privacy Regulation) came into effect, imposing a whole bunch of new data-privacy requirements on companies which do business with EU citizens.

Since almost all large cloud services are international, many have simply done a blanket update to their privacy policies and terms of service to comply with the law for all of their customers, regardless of nationality. That's why you've been receiving emails lately.

For the most part, not much will change with your day-to-day interactions with these websites, but if they didn't provide it before, you can probably now submit a request for all the data they have on you and submit a request to have your information completely deleted. There's a whole bunch of other rights, too - in fact, you can read the full text of the law here: https://gdpr-info.eu/

18nleung··on An industry has developed around the online resale of clothes
Reminds me of StockX - so-called “Stock Market of Things” that was launched a few years ago. StockX, however, deals only in unworn/unused sneakers and streetwear.
18nleung··on Free static websites with SSL for hackers
Seconded - all you have to do is specify a build command and an output directory and Netlify will build your site on every commit to master. You can easily add a custom domain, manage DNS, and get Let’s Encrypt SSL with the click of a button.

Not affiliated either, but I’ve been blown away by how seamless their service has been.

18nleung··on GitMask – Develop Anonymously
Unrelated to the GP, but I really like the design of the landing page — did you put it together yourself?
18nleung··on The fifth hyperfactorial: 5⁵ × 4⁴ × 3³ × 2² × 1¹ milliseconds is exactly 1 day
Looks nice in Haskell too.

  product (map (\n -> n ^ n) [1..5]) == 1000 * 60 * 60 * 24
  => True
18nleung··on The fifth hyperfactorial: 5⁵ × 4⁴ × 3³ × 2² × 1¹ milliseconds is exactly 1 day
That's really interesting - only about 2% off.

Conversion Here: https://www.wolframalpha.com/input/?i=speed+of+light+in+feet...

18nleung··on Americans Are Dying Younger, Saving Corporations Billions
Could you elaborate? I myself haven't seen much compelling evidence against GMOs.
18nleung··on REST in Peace. Long Live GraphQL
GraphQL supports both queries to access data and _mutations_ to change data:

  mutation {
    createUser(u: "user", p: "pass") {
      u,
      p
    }
  }
18nleung··on The non-linearity of productivity
Agreed. I often figure out a solution to a problem I'm having as soon as I stand up from my desk!
18nleung··on Things to learn in React before using Redux
This sounds like a good use case for Promise.all() and fetch:

  const first = fetch(endpoint1);
  const rest = Promise.all([
    fetch(e2), fetch(e3), fetch(e4),
  ]);
  // cancel here
  const json1 = await first.json();
  const json234 = await rest.json();
While native promises can't cancel on their own, with a library like Bluebird you can get that functionality.
Page 1 of 2Next →