HNHacker News
TopNewBestAskShowJobs

johncs

204 karma · joined December 23, 2014

https://johncs.com
submissionscomments
johncs··on Show HN: Trail – new kind of logic game
Needs difficulty modes, or a steeper curve. Too easy for too long.
johncs··on docker2exe: Convert a Docker image to an executable
Basically the same as Python’s zipapps which have some niche use cases.

Before zipapp came out I built superzippy to do it. Needed to distribute some python tooling to users in a university where everyone was running Linux in lab computers. Worked perfectly for it.

johncs··on Google Search: Roboto Mono
Thank you! It’s the Solarized color scheme which is definitely a bit low-contrast. I probably don’t notice it only because I’ve been using the color scheme across apps for so long.
johncs··on Google Search: Roboto Mono
I do wish monospace designs were at least a _little_ trendier. My blog uses one, but honestly I feel like I should change it up since I'm looking for roles right now and I worry it doesn't _delight_ like modern designs right now.
johncs··on Iterating on an HTML resume with GPT-4o via cURL
> I have been manually copying my resume source into ChatGPT for feedback

That’s what I started out doing as well. At some point I got tired of it, and after writing the script I realized the tighter feedback loop was really nice.

johncs··on Ask HN: Who wants to be hired? (June 2024)

    Location: Portland, OR
    Remote: Yes
    Willing to relocate: Yes (Only to the Bay Area)
    Technologies: Most recently TypeScript, Python, React, PostgreSQL, GCP.
    Resume: https://resume.johncs.com
    Email: johnsullivan.pem@gmail.com
Full-stack engineer with professional experience in other areas including Unity, desktop, mobile, and set-top boxes. I've founded two small businesses with modest success but prefer the life of an IC.

I started programming 24 years ago when I was 7 and have been continuously loving and learning more about my craft since.

I've very recently started looking for a new IC role once again. I am interested in Senior/Staff roles that will allow me to continue expanding my knowledge.

johncs··on Ask HN: What have you created that deserves a second chance on HN?
A small little toy: https://particles.johncs.com
johncs··on Perhaps it is a bad thing that the leading AI companies cannot control their AIs
There's a great Computerphile video from 2015 that introduced me to the idea of AI safety awhile ago. It seems like some good context to this article: https://www.youtube.com/watch?v=tcdVC4e6EV4
johncs··on Ask HN: Have you set up a procedure to disclose your passwords in case of death?
Yes. I run a small website and a friend of mine has agreed to take it over if I die. I've shared the passwords of the services that the website is hosted on with them via a package manager.

I do not have anything similar for my bank accounts or personal subscriptions.

johncs··on Can We All Just Admit React Hooks Were a Bad Idea?
This article asserts SOLID and MVC is good with basically no justification. It also doesn’t show how non-hooks code would be better.
johncs··on SL(1): Cure your bad habit of mistyping
Ah of course you meant in a word processor...

    $ never mind
    -bash: never: command not found
Thought I was about to learn about a new utility for a moment.
johncs··on GnuCash
For those of you who like the idea of GNUCash but are looking for an easier tool to use (for us developer folks), check out https://plaintextaccounting.com.
johncs··on My mate is making a tool for DnD players to quickly visualise scenarios
Seems to be going after the same problems that https://shmeppy.com does. The specific choices are different though (like drawing is much different).
johncs··on Show HN: PgCat, Postgres pooler with sharding, load balancing and failover
You got a good laugh out of me with the meow in your description.
johncs··on Jo – a shell command to create JSON (2016)
Ended up sniping myself . Made a fairly complete version of what I was imagining: https://github.com/itsjohncs/construct-json#readme
johncs··on Jo – a shell command to create JSON (2016)
In the common case where you trust your input entirely you can just interpret your string as JavaScript. Then you don't even need to use quotes for the key names.

    $ alias fooson="node --eval \"console.log(JSON.stringify(eval('(' + process.argv[1] + ')')))\""
    $ fooson "{time: $(date +%s), dir: '$HOME'}"
    {"time":1457195712,"dir":"/Users/jpm"}
It may be a bit nicer to place that JavaScript in your path as a node script instead of using an alias.

    #!/usr/bin/env node
    console.log(JSON.stringify(eval('(' + process.argv[2] + ')')))
Since fooson's argument is being interpreted as JavaScript, you can access your environment through process.env. But you could make a slightly easier syntax in various ways. Like with this script:

    #!/usr/bin/env node
    for(const [k, v] of Object.entries(process.env)) {
        if (!global.hasOwnProperty(k)) {
            global[k] = v;
        }
    }
    console.log(JSON.stringify(eval('(' + process.argv[2] + ')')))
Now environmental variables can be access as if they were JS variables. This can let you handle strings with annoying quoting.

    $ export BAR="\"'''\"\""
    $ fooson '{bar: BAR}'
    {"bar": "\"'''\"\""}
If you wanted to do this without trusting your input so much, a JSON dialect where you can use single-quoted strings would get you pretty far.

    $ fooson "{'time': $(date +%s), 'dir': '$HOME'}"
    {"time":1457195712,"dir":"/Users/jpm"}
If you taught the utility to expand env variables itself you'd be able to handle strings with mixed quoting as well.

    $ export BAR="\"'''\"\""
    $ fooson '{"bar": "$BAR"}'
    {"bar": "\"'''\"\""}
You'd only need small modifications to a JSON parser to make this work.
johncs··on Show HN: Looptap – A minimal game to waste your time
Oh hey, it’s one of Fable’s mini games! Very cool to see
johncs··on Ask HN: What you up to? (Who doesn't want to be hired?)
I've been contributing to the IRC ecosystem again. Working on bringing some IRCv3 [1] features to The Lounge [2] right now.

Tryna do some neat things with the virtual tabletop I've built (Shmeppy [3]) as well. Getting its renderer off of the 2D Canvas API and onto WebGL, as well as some of its more perf-sensitive code onto WASM.

[1] https://ircv3.net [2] https://github.com/thelounge/thelounge [3] https://shmeppy.com

johncs··on The Troublesome Active Record Pattern
> This pattern of access is simple and intuitive but causes huge problems in even small projects. Retrieving whole rows is hugely wasteful when only part of the row is required to resolve a user request.

Retrieving a whole row rather than just a single column from a database that's likely on a local network definitely doesn't seem "hugely wasteful", especially for smaller projects.

johncs··on A common mistake involving wildcards and the find command
I set failglob: `shopt -s failglob`. Makes the whole command fail if there's no matches. That combined with `set -e` which aborts the script in the event of any command failing makes me feel somewhat safe.

Indeed I add the following two lines to every bash script I write:

    set -exu
    shopt -s failglob
johncs··on Ask HN: teaching basic coding and web design offline, solely via iOS devices?
If there's a network/intranet available that you can connect to, that just can't access the internet, you should definitely check out Khan Academy Lite: https://learningequality.org/ka-lite/.

It has much more than just basic coding and web design too :).

johncs··on Why I am pro-GPL
I think the AGPL addresses this concern.
johncs··on Ask HN: Company got acquired, new contract seems oppressive
If you're in California I can give you a recommendation (I have no affiliation with him aside from hiring him in the past). I don't know of a general way of finding a lawyer on short notice.
johncs··on Why do women have periods when most animals don't?
There were a few explanations proposed. This was one of them, but it was unclear if this is the theory with the most support.