HNHacker News
TopNewBestAskShowJobs

JohnDotAwesome

416 karma · joined November 30, 2012

Web Maker. Typescript Lover. Math and science enthusiast. Guitar fiddler. Follower of the almighty noodliness. @kilo.ai http://j0.hn
submissionscomments
JohnDotAwesome··on 5x5 Pixel font for tiny screens
Amazing. I zoomed in with my phone on the generated image and was surprised to see I could just make out the text! https://storage.j0.hn/subpixelfont.png - Also wow my screen is dirty af
JohnDotAwesome··on TypeScript please give us reflection/runtime types
Instead of pleading to the TypeScript gods, why not make a deal with the JavaScript deities? Let's get type-checking into JS!

If I want runtime types, I reach for type guards. If I need to do this a lot, then I reach for io-ts or zod and pretty much exclusively write types as validators/codecs/schemas or what-have-you.

I don't think TS - as a specification, type-checker, community, or otherwise - needs to concern itself with runtime validation UNLESS JS gets some agreed upon way to do it.

JohnDotAwesome··on Things I wish I’d known before fulltime RVing (2017)
New number, whodis
JohnDotAwesome··on Things I wish I’d known before fulltime RVing (2017)
As an RV-driver, I try my best to use the pull outs when I can. There are a few complications, though.

First is the visibility of these pull-outs is often very poor. You'll be driving through long winding roads and then all of the sudden the pull-out appears. In an RV, you can't just slam on the breaks and swerve into the pullout, ESPECIALLY if you're going downhill.

Second, often times (in the USA at least), these pull-outs have rough terrain going in an and out of them. There will be a little bump or uneven ground that most vehicles wouldn't mind hitting every now and then, but in my rig, that causes the whole thing to sway back and forth (Class-C built on a Mercedes Sprinter). I REALLY need to upgrade the suspension.

Third is time. Since I'm slower than everyone else, people tend to pile up behind me pretty quickly. Pulling into the pull-out, coming to a complete stop, waiting for everyone to pass, then getting back up to speed takes a long time. If I did this every time there was a car behind me, it would take forever. So, I tend to wait until there's more than a few cars behind me before pulling off.

Fourth is my wife. She says I have "overly-considerate disorder" and I need to make our safety #1 and stop caring about other people so damn much.

JohnDotAwesome··on A text adventure game on TypeScript's type system
For those wanting a TS Playground link: https://tinyurl.com/mw6pbpht
JohnDotAwesome··on Electronic Catan LCD Tiles
I think it's less about the game mechanics and more about the viscerality. Board game players tend to prefer physical representations they can feel and fiddle with.
JohnDotAwesome··on Ask HN: Show me your half baked project
I built an app around the HTML invoice template I had been using for years. https://www.cannonvoice.com/

I used this project as a training ground for a ton of different ideas and technologies. From server rendered react to typescript and design systems to how the hell kubernetes works. I went from dokku, to lando, to trying to figure out Consul and Hashicorp stuff to managed K8s on digital ocean. I decided to try to only write SQL and create my own typesafe patterns with TypeScript. It didn’t work out all that great but it wasn’t all that bad either.

This is half baked because I had so many more plans for a product no one asked for. Definitely one of the best learning experiences I had. I started with a monorepo of modules and realized that was a stupid idea for an app. I developed some strong opinions along the way. Oh I reimplemented email auth for the nth time but this time I used postgres’s built-in crypto functions. Man I like this implementation

JohnDotAwesome··on The Web Began Dying in 2014 (2017)
I’ve been using self-hosted Matomo for https://www.cannonvoice.com since I launched a couple of weeks ago. Man this is some neato software! On top of that it was super easy to deploy to the K8s cluster that runs the app. +1 would recommend.

To folks saying to “Just use server logs”, it’s simply too hard to connect the dots unless you really know what you’re doing. Digging through my nginx logs to find that the majority of my users are dropping off at the second step of sending an invoice would be nearly impossible. Oh I could connect those logs to my api’s database, now I need a place to aggregate that data together. Maybe I could send all of that data together to elasticsearch and query with kibana. Now I need to learn how To set those things up.

Or I could use Matomo for some analytics real quick

JohnDotAwesome··on Show HN: Launching my side project – Build and send invoices with ease
> So you used an SPA framework like angular/ember or is it pure JS?

Just React and Mobx

JohnDotAwesome··on Show HN: Launching my side project – Build and send invoices with ease
> That's interesting, do you get enough volume (or foresee it in future) to justify Kubernetes?

Absolutely not. I chose kubernetes because I was interested in learning more about it

JohnDotAwesome··on Show HN: Launching my side project – Build and send invoices with ease
I've been building this product for a while. Even though there aren't any loading indicators, I think it's still good enough to get out there!

I've used this project as a test bed for learning new technologies. And what did I learn? That using Docker and Kubernetes effectively is harder than I thought it would be.

Some maybe interesting things about the technology used:

  * It's almost 100% TypeScript
  * What's not TypeScript is plpgsql
  * Postgres
  * Nodejs
  * Docker
  * Deployed to a Kubernetes cluster
  * React on the frontend
  * React also renders HTML on the backend (for the PDF generation and emails too)
JohnDotAwesome··on Migrating 300k LOC from Flow to TypeScript
As someone who has also been using TypeScript for over a year and JavaScript for over 10 years, I've had a different take on it.

Disclaimer, I freaking love JavaScript and TypeScript.

> TypeScript is a hack of epic proportions and every so often the reality rears its ugly head in the form of failed source mapping, version compatibility issues, unexpected types during runtime, poor architectural decisions aimed at pleasing the compiler instead of fulfilling project goals.

This just sounds like JavaScript to me. Maybe TypeScript has helped elucidate those problems for you. TypeScript adds some syntax to help formalize solutions to these problems that existed in JavaScript already.

> TypeScript is a very poor way to model real-world systems because it incorrectly assumes that real-world entities have a fixed type schema

This sounds to me like programmer error. TypeScript provides facilities for unknown structures, or structures that have multiple possible definitions. There is the union type for which we can tell the compiler that a value can be of type `A[ or B[ or C[ or... ]]]`. Perhaps even more powerful is optional types. In interface you'd describe an optional field with a question mark, like `{ foo?: string }`. Alternatively, you could use the union type described above, unioned with `undefined`. These structures help you create types that actually do model the uncertainty of data coming into your program. If you're not using these techniques, then you're missing out! Having the type-checker yell at me because I didn't check for the undefined case is a really really cool thing.

> Why not force the developers to account for as many cases and schemas as possible, it's our job!

I would argue that TypeScript provides the vocabulary for doing just that and that JavaScript provides no such niceties. Sure, you provide run-time checks on a piece of datas validity, but there's no system to check that run-time behavior before code gets merged to master.

If you're not running `"strict": true` and annotating your TS code with optional values when data is coming into your program, you might have a bad time.

JohnDotAwesome··on The TypeScript Tax
The compiler can most definitely type-check that code. It's up to you whether or not you want to ignore certain types errors. Want to ignore monkey-patching related errors? Filter out all lines from tsc that include TS2339.
JohnDotAwesome··on Low.js – Node.js for embedded devices
Super cool. I had never heard of Duktape before. Seems like there should be some work making Electron compatible with Duktape to reduce the memory overhead of some of our favorite Electron apps cough VScode cough Slack.

(This is probably a naive comment. I have no idea if this would work the way I assume it would).

JohnDotAwesome··on Launch HN: Toybox (YC S18) – Communicate changes to sites without writing code
Wow this is really neato! Often times, I find myself not only changing CSS, but editing the HTML. Does that work in Toybox?
JohnDotAwesome··on XARs: An efficient system for self-contained executables
I really wish I did have more than one middle name, both of which starting with `R` (indeed, my middle name does start with R). Maybe then as a J.R.R. Fawcett I could write fantasy novels.
JohnDotAwesome··on XARs: An efficient system for self-contained executables
Names are hard. My name is John. Programmers get really confused when I tell them that. "Did you know there's another programmer named John? You probably should have researched names before you decided to go with that one"
JohnDotAwesome··on XARs: An efficient system for self-contained executables
Seems like Habitat (which looks awesome by the way) relies on Docker. Which, if you consider performance heuristics in the article (size, cold/hot start time), may be a non-starter for what they're trying to do.
JohnDotAwesome··on Show HN: TaskBotJS – TypeScript and JavaScript background job processing
Very nice job! I'll definitely be trying this out in a personal project.

How's your experience been with TypeScript and oao? I've got a very large monorepo (using yarn workspaces) of TypeScript modules and it's been sort of a PITA. For instance, a typical yarn install will unnecessarily duplicate some dependencies across packages causing tsc to complain about duplicate identifiers. Running yarn --check-files fixes this, but it's still annoying. Also, following symbols with yarn workspaces is sometimes annoying since linked packages will use "main" and "types" fields in the package.json, thus following a symbol takes you to the generated type definition. I have a generated tsconfig.json that sets paths to their appropriate package paths to fix that. Again annoying.

JohnDotAwesome··on Serverless Performance: Cloudflare Workers, Lambda and LambdaEdge
That seems right. Should probably be longer. Each second, a new chunk is emitted with the appropriate html to hide the old clock element and show the new.
JohnDotAwesome··on The Dasher Project
Basically imagine inputting text with your mouse like this:

http://www.inference.phy.cam.ac.uk/dasher/images/newdasher.g...

JohnDotAwesome··on Two Vortex Rings Colliding in Slow Motion [video]
I used to notice something similar in college.

cough We were smoking a lot of... various things. I had setup a chill room that didn't have any air conditioning (so it was actually very hot; a hot box if you will). Just a small room where smoke would accumulate.

At any rate, I got very good at blowing smoke rings. In the still room, you could blow a smoke ring and it would expand for about a minute before dissipating. The more substantial rings would do something really crazy. They'd spawn a new, smaller ring, but going the opposite direction. I believe this was only the case if the ring was blown upward.

I don't know if this is related to the Two Vortex Ring Collision experiment, but it was definitely fun to watch!

JohnDotAwesome··on 9,096 Stars in the Sky – Is That All?
> I’ve been in parts of the country where there’s complete blackness in the new moon. I didn’t stop to count the stars, but it looked much more like the second picture than the first one. The Milky Way is astonishingly vivid and the stars are endless.

I just got back from Exuma Island in the Bahamas. This is a decently remote island without much light pollution. It was by far the best star-gazing I've ever experienced. I've backpacked in Big Bend, Yosemite, and Yellowstone (and less notable areas), Exuma takes the cake for looking at the heavens.

I say all of this because the picture on the left seems much more representative of the _best star-gazing conditions I've ever witnessed_. The Milky Way was big and beautiful; It caused my S.O. and I to sit outside for 1.5 hours just staring. But it still looked more like the first picture.

Maybe you were mis-remembering, or maybe your vision is just better for these sorts of things. Either way, I want to know where you were to see the second picture.

JohnDotAwesome··on What Did Ancient Romans Do Without Toilet Paper?
Bidets are pretty weird, but I totally recognize their superiority to plain ol' toilet paper.

+1 for wet wipes.

JohnDotAwesome··on Surgeons urge people to throw out bristle BBQ brushes (2016)
I've always used aluminum foil. Just wad it up and scrub
JohnDotAwesome··on Run JavaScript on Cloudflare with Workers
The short answer is webpack!

The long answer is webpack, rollup, or browserify :)

JohnDotAwesome··on Hyperloop One Becomes ‘Virgin Hyperloop One’
I was thinking "Richard" - "d" = "Richar" or "richer"
JohnDotAwesome··on Cloudflare Workers: Run JavaScript Service Workers at the Edge
Relevant example using Preact https://cloudflareworkers.com/#87ec550da87ab3f7de756a4979c00...
JohnDotAwesome··on Cloudflare Workers: Run JavaScript Service Workers at the Edge
https://cloudflareworkers.com/#1f3220d90979ded0b1f5413db0eac... this fixes the styling issues :D
JohnDotAwesome··on Three Paths in the Tech Industry: Founder, Executive, or Employee
Is it really typical in SV tech to get that much matching on 401k and/or get a bonus? Seems extraordinarily high. Maybe that bonus, stock, 401k match is sort of an unknown that one may or may not receive (in which case, you'd be comfortably saving $10k/year).

At any rate, if those bonuses are real, maybe I need to move out of Texas.

Page 1 of 3Next →