News for hackers. Stuff that matters.

JohnDotAwesome

Re:5x5 Pixel font for tiny screens on Wednesday April 22, 2026 @05:27PM (#47869510)
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
Re:TypeScript please give us types on Friday July 07, 2023 @04:22PM (#36637802)
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.

Re:Things I Wish I’d Known Before Fulltime RVing (2017) on Tuesday June 20, 2023 @04:46PM (#36410270)
New number, whodis
Re:Things I Wish I’d Known Before Fulltime RVing (2017) on Tuesday June 20, 2023 @04:28PM (#36410014)
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.

Re:A text adventure game on TypeScript's type system on Wednesday September 21, 2022 @05:30PM (#32931760)
For those wanting a TS Playground link: https://tinyurl.com/mw6pbpht
Re:Electronic Catan LCD Tiles on Sunday May 29, 2022 @01:37PM (#31550998)
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.
Re:Ask HN: Show me your half baked project on Saturday January 09, 2021 @01:49PM (#25703231)
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

Re:The Web Began Dying in 2014 (2017) on Sunday November 24, 2019 @01:06PM (#21622128)
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

> So you used an SPA framework like angular/ember or is it pure JS?

Just React and Mobx

> 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

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)
Re:Migrating 300k LOC from Flow to TypeScript on Thursday June 20, 2019 @10:30AM (#20233263)
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.

Re:The TypeScript Tax on Friday January 25, 2019 @05:14PM (#19003086)
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.
Re:Low.js – Node.js for embedded devices on Saturday September 15, 2018 @05:52PM (#17996202)
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).

Wow this is really neato! Often times, I find myself not only changing CSS, but editing the HTML. Does that work in Toybox?
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.
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"
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.
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.

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.
Re:The Dasher Project on Monday June 25, 2018 @06:55PM (#17396537)
Basically imagine inputting text with your mouse like this:

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

Re:Two Vortex Rings Colliding in Slow Motion [video] on Sunday June 24, 2018 @09:18PM (#17389321)
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!

Re:9,096 Stars in the Sky – Is That All? on Sunday April 29, 2018 @05:52PM (#16954112)
> 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.

Re:What Did Ancient Romans Do Without Toilet Paper? on Wednesday April 04, 2018 @06:10PM (#16759717)
Bidets are pretty weird, but I totally recognize their superiority to plain ol' toilet paper.

+1 for wet wipes.

I've always used aluminum foil. Just wad it up and scrub
Re:Run JavaScript on Cloudflare with Workers on Tuesday March 13, 2018 @09:45AM (#16576010)
The short answer is webpack!

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

Re:Hyperloop One Becomes ‘Virgin Hyperloop One’ on Thursday October 12, 2017 @11:58AM (#15458902)
I was thinking "Richard" - "d" = "Richar" or "richer"

Older »