HNHacker News
TopNewBestAskShowJobs

tony

2,601 karma · joined October 29, 2013

open source software plumber

author: The Tao of tmux (https://leanpub.com/the-tao-of-tmux) available to read for free online at https://leanpub.com/the-tao-of-tmux/free

software libraries: cihai, unihan-etl, tmuxp, libtmux, vcspull, libvcs

https://tony.sh

(If what I say isn't helpful to you, disregard it. Spread the good will and good tidings!)

submissionscomments
tony··on Forge – A Django SaaS Framework
I wouldn't limit django patches to just being new features. Ample room for incremental improvements.

There are some parts of django core that are stable, but fundamentally broke for non-trivial apps. Let's just take /admin:

- Can inline admin models be paginated? Searched? Both? Asynchronously?

- Use autocomplete_fields by default via ID/PK lookup / when `search_fields` exist. Right now related fields will load the whole table into a <select> box. This is an absurd default.

Other opportunities that'd be universal:

- Integrate channels into admin

- AJAX form validation

- Revision history that includes actual values / diffs / undo

tony··on Forge – A Django SaaS Framework
I think this makes sense. Ideas:

- Showcase your reciprocal contributions you make back to django community packages (e.g. Jazzband packages).

- Release a permissively licensed django package (with no catches) under your GH's org and brand name and have it take off. (e.g. django-forge-admin)

- The holy grail would be contributions to django itself. Example: Adding more CSS variables in django admin to font-size and font-family. Add rem, %, calc, flex, etc.

- Early startups funding: $5,000 for MVPs up into 6 figures. Your price point could be a bit higher. Email early founders and see what their reaction is. Use that feedback to tailor a business-friendly license to address the concerns of people with decision making powers. Commenters opinions matter, but they're not necessarily your clientele.

- Strike custom deals to make the sale.

- Add on custom development hours and add a clause to incorporate the work back into your product for reuse.

- Expect to be reaching out to founders often, using cold email introductions, both for advice, but also to show you're flexible. Be willing to hop on a zoom, demo it, etc.

- Find early startups to use your framework for testimonials and social proofing.

- I've personally set these up before many times in django at previous places. It takes weeks of effort to bootstrap, especially if you factor in billing. No it's not 8 hours. It's weeks of effort.

My only doubt is, I think you may ultimately make more money striking big deals to do development work. What's more efficient, a $100-$150k deal with one customer or being on the hook for 100 customers?

tony··on AWS price reduction for data transfers out to the internet
I've tried AWS amplify and some cloudflare pages. I'm looking into some of those others for gatsby / next.js hosting.

For gatsby sites and webpack apps, I did ultimately figure out and simplify my s3 / cloudfront deploys and only invalidate index.html.

Ultimately it looks like I'm going to be migrating away to sphinx-doc. It's not up to date with the best practices in static site apps these days.

tony··on AWS price reduction for data transfers out to the internet
Cache invalidations are the ones that will really get you bad in CloudFront if you're not careful [1].

As a new user, I was working on publishing open source documentation via CloudFront (https://tmuxp.git-pull.com) and made a mistake of invalidating '*', and doing it every time I pushed to CI. This was sphinx-doc, so no cache-busting filenames.

My bill was absolutely enormous. I chewed threw the free tier credits.

If CloudFront ever gets more generous with invalidations, that'd help reduce the sting for those of us that make those early mistakes.

[1] https://docs.aws.amazon.com/AmazonCloudFront/latest/Develope...

tony··on Ugit - DIY Git in Python
Does anyone know the tool to use used to generate the site?

e.g. Is it using plugin for a static site generator?

tony··on CNLabelContactRelationYoungerCousinMothersSiblingsDaughterOrFathersSistersDaught
Why not an enum? Is it an API stability thing?

https://docs.swift.org/swift-book/LanguageGuide/Enumerations...

Looks like someone beat me to this (2019): https://news.ycombinator.com/item?id=20352473, the reply to it perhaps gets to the reason why. Something about Objective C's enums being different.

See here: https://stackoverflow.com/a/13480621

tony··on Ask HN: Why Poetry did not become a mainstream package manager for Python?
Poetry does need help. I created a thread here: https://github.com/python-poetry/poetry/issues/4160

my primary concern poetry's development stagnating due to natural causes while many projects rely on it. switching costs are high. moving from pipenv -> poetry took me days across all my projects.

they're looking for developers, but also help with managing issues on the tracker.

i also raised the issue of them being funded. I think one possible outcome is seeing if PSF's Fiscal Sponsoree program (https://www.python.org/psf/fiscal-sponsorees/) would be a fit. Waiting to see what their maintainers say.

tony··on Docusaurus 2 Beta
I inherited 11ty from a boilerplate, but to be fair to them, people do amazing stuff with it: Example https://web.dev/how-we-build-webdev-and-use-web-components/.

Back to docusaurus, one weakness is the lack of API documentation tools. Check to see if the programming language for your project has a docusaurus (or a markdown) API generator.

For Python, if you use docusaurus, there's no API documentation generation is nowhere near Sphinx.

Sphinx uses sphinx.ext.autodoc (https://www.sphinx-doc.org/en/master/usage/extensions/autodo...). The dream would be getting a python API like this ported to docusaurus: https://libtmux.git-pull.com/api.html

This can supposedly do it via exporting the API to markdown: https://github.com/NiklasRosenstein/pydoc-markdown

tony··on Docusaurus 2 Beta
I moved from 11ty / eleventy to docusaurus here: https://social-embed.git-pull.com/

Pluses:

- Very active project

- Nice theme out of the box / configuration. Better than any static site generator I've used thus far

- React components / pages

- Configurability, both by settings, plugins. I was able to add a (non-react) custom element to the static build output

- The sidebar, which supports nesting

- Table of contents on the right side. Highlights current section + supports nesting

- Algolia search adds a ton of value. There's a plugin for it: https://docusaurus.io/docs/search

- Dark / light mode

- Can sorta host API docs, if you can generate Markdown for your API, docusaurus can show it: https://social-embed.git-pull.com/docs/lib/api, https://social-embed.git-pull.com/docs/wc/api/classes/oembed...

- Supports namespacing between releases (e.g. v1.1, v1.2) and multiple languages

tony··on Pg_tmp – Run tests on an isolated, temporary PostgreSQL database
The author is Eric Radman. The visionary behind the entr(1) file watcher http://eradman.com/entrproject/

GitHub: https://github.com/eradman, also:

rset(1): http://scriptedconfiguration.org/ - Configure systems using any scripting language

tony··on Audacity 3.0
For those interested Audacity's underlying design, it's featured in The Architecture of Open Source Applications: https://www.aosabook.org/en/audacity.html

There's a section that references .aup files, see 2.6. BlockFiles (Audacity 3.0.0 introduces the .aup3 file format)

The most memorable parts of this to me was wXWidgets. Here's ShuttleGUI:

https://github.com/audacity/audacity/blob/master/src/Shuttle...

tony··on Ask HN: What projects exist to consolidate our professional identity online?
It's difficult to curate content across multiple platforms. Likely due to duplicate detection. It may be a good idea for a startup, if you can group similar items so the feed isn't messy, it'll look clean. Think android notifications.

Sibling commenters are correct, I think a static site generators are the gold standard, since you'll be able to curate the feed to the way you usually post. Judging by your interest in aggregating, it seems Gatsby may be a fit:

Gatsby allows aggregating sources, e.g. https://www.gatsbyjs.com/plugins/gatsby-source-twitter/, https://www.gatsbyjs.com/plugins/gatsby-source-instagram/, https://www.gatsbyjs.com/plugins/gatsby-source-medium/

From scratch, I created a CV that aggregates all my GitHub stuff and hard codes the rest:

v1: https://cv.git-pull.com, https://github.com/tony/cv/tree/v1/react

v2: https://cv-react-v2.git-pull.com, https://github.com/tony/cv

tony··on Why Become a TypeScript Fan?
Love TypeScript.

tsc by itself is amazingly fast. Writing stuff in TypeScript has huge benefits, you can still publish your packages so they work in plain-old ES. Interfaces that define structure of objects go a long way to reign in a codebase of unknowns.

Also, various benefits when editing: Type-based checks via tsc and linter, autocompletion (life saver). These things add up quickly in a big codebase.

That's not to speak of utility functions: https://www.typescriptlang.org/docs/handbook/utility-types.h...

I will nitpick one area: generics. While I use them a lot in practice, I seldom write new ones. Example:

In DefinitelyTyped's definitions for @types/react, it makes sense to have a generic in React components. This lets the user pass-in their own interface for their props, e.g.

    const MyComponent: React.FC<{ isFirst: boolean }> = ({isFirst, children}) => (
      <div className={`${isFirst ? 'first' : 'after' }`}>{children}</div>
    )
Declarations for React's FC (points to `FunctionComponent`): https://github.com/DefinitelyTyped/DefinitelyTyped/blob/9d56...

In the case of a widely used library, generics make sense at scale. It's reused and components revolve around the shape of props. Not to mention, DefinitelyTyped's superb community, continuous integration and maintainers around the globe.

Microsoft keeps pushing open source forward in so many ways.

Anyway - Outside of that, I've come to eschew writing new generics internally. The reason why is complexity not being worth the trade offs. I'd rather use generics already available (see utility types above). Less cognitive overhead.

tony··on Esbuild 0.9
For those relying on babel - what are the options?

One thing I haven't seen yet is support for SCSS and CSS Modules. It looks like projects on those would need to switch to emotion+styled-components or styled-system, which would be a big move.

If anyone uses relay, I started an issue here about using it with next-gen bundlers like esbuild: https://github.com/facebook/relay/issues/3319

For those who don't know, relay is a graphql system by facebook. It seems dependent on babel (to my knowledge?) Two developments on this front:

1. @sciyoshi built an esbuild proof of concept for relay: https://gist.github.com/sciyoshi/34e5865f2523848f0d60b4cdd49...

2. Meanwhile, the compiler has been being quietly rewritten in rust: https://github.com/facebook/relay/tree/master/compiler. They're also claiming that it will include type generation.

tony··on Ask HN: What's the coolest YouTube channel you've found in the past month?
Thank you for these resources. History documentaries:

- Montemayor: https://www.youtube.com/channel/UCX7katl3DVmch4D7LSvqbVQ

- The Operations Room: https://www.youtube.com/channel/UCnZJt7yQw5IztVwe-Dscd-Q

They take the time to make quality videos (even if it takes week or even months) as opposed to others that rapid fire publish videos.

Some channels I'd previously recommend had quality drop. Rather than investing in a topic they got a spammy feel to them.

tony··on Ask HN: Remote workers in a non-tech city, what's your experience?
RGV (Rio Grande Valley, TX) is excellent. Highly affordable. I save a lot here and don't miss anything.

Opportunities open themselves up as well. You can get a really nice homes here: https://www.zillow.com/mcallen-tx/ + hit "remove boundary". You could snap up houses here and rent em. Buy one. This is a market where I could see it growing in the next 5-10 years with more remote work.

Dallas, Houston, and Austin were all viable opportunities but the cost just didn't have the value. Harlingen / Brownsville / McAllen, if you google it, often come up dead first for cheapest cities.

That said, it's way out there. TX is super big. This is 2.5+ hours away from Corpus Christi, 5 hours away from Houston. It makes flying a pain. So it doesn't fit a lifestyle where you need to bounce around a lot. So I highly doubt the prices will fluctuate much, but a lot of TX is like that.

And the SpaceX Starship place is near us (Boca Chica, TX)

tony··on 'Megascale' structures that humans could one day build
Anyone remember SimCity 2000's arcologies?

https://simcity.fandom.com/wiki/Arcology

https://en.wikipedia.org/wiki/Arcology

tony··on Ask HN: What are you working on?
I'm working on a new version of my CV (v1: https://cv.git-pull.com)

I keep it at https://github.com/tony/cv. It's in the very early stages

This time I'm writing it in React, Angular, and Vue (TypeScript across the board).

While doing it, I've tried to find various ways to share the chart and data code across all 3 versions. The library I found to make it happen with data akita: https://datorama.github.io/akita/

For UX it's not so easy. The truth is, some of the best UI libraries are framework specific. This creates a lot of fragmentation in the frontend community IMO. For instance react has nivo, victory, and react-vis, but at the end of the day it's svg and canvas underneath the hood. Still though, the efforts are amazing. It makes you wonder what it'd be like if there would be just one agreed upon way to write a widget. (There's web components, custom elements... but those won't even work with typescript out of the box)

In the past few years, that stuff that's been going on with webpack v5's persistent caching, TypeScript (and its tooling), and all 3 of these frameworks getting better is amazing.

Examples of charting software I've tried: https://cv-react-v2.git-pull.com/dev/branch/v2-billboard.js/, https://cv-react-v2.git-pull.com/dev/branch/v2-plotly/, https://cv-react-v2.git-pull.com/dev/branch/v2-carboncharts/

For the first time I've found a UI suite called Carbon: https://www.carbondesignsystem.com/, an IBM thing. I'm most impressed by their chart offering. Even though it's relatively new, they maintain bindings for react, vue and angular.

tony··on Ask HN: How to develop empathy?
Why Are People Mean? by Donald Carveth, PhD

http://www.yorku.ca/dcarveth/Why%20Are%20People%20Mean.pdf

tony··on Burnt $72k testing Firebase and Cloud Run and almost went bankrupt
Google eventually forgave the bill in Part 2: https://blog.tomilkieway.com/72k-2/

> Google let go of our bill as a one time gesture!

Thank goodness.

And it looks like it had to do with not understanding the API / system on the first order, IMO.

This hit me hard a few months ago with CloudFront invalidations on AWS. I check billing and the things at 30usd in a single day, from a norm of <1usd per month, so it's showing a 13,000% increase (this is for documentation of open source projects). I'm writing their support and at the mercy so to speak - technically I ran up the bill. I ended up paying up, but I secretly hoped I'd get some AWS credits for the projects, heh

Aside: Amazon has some nice features for rule-based alarms on accounts so when you spend more than X dollars, you get an email.

tony··on Ruffle – A Flash Player emulator written in Rust
What's Newgrounds affiliation with Ruffle? Did they create it?

To test it out: https://www.newgrounds.com/portal/view/113883

No flash player required. Works in HTML 5.

Loaded slow though.

There's a cool song in it: Splashdown - So Ha

Is Albino Blacksheep in on the ruffle.rs stuff? Remember them? They were always pioneering CSS stuff back in the 2000's.

tony··on Ubuntu Linux Jail on FreeBSD 12.2-Release
Also interested in the response to the parent (loeg)

> facing many of the same difficulties that prompted the Windows team to just run Linux in a hypervisor

If by difficulties, you mean implementing system calls, this is being kept tabs on here: https://wiki.freebsd.org/Linuxulator

One that comes to mind is FreeBSD's kqueue, which opens a file descriptor for every file watched [1]

So inotify, inotify_add_watch, inotify_rm_watch isn't started. Lots of applications need watching of changes on directories. Even plain old FreeBSD gets messed since a large webpack project is going to chew up way too much.

If you're interested in this type of system call across operating systems check out https://github.com/emcrisostomo/fswatch

On WSL1/2:

Namely in WSL1, there were serious issues with package systems like npm, node_modules/ would have file descriptors get clogged, and it took a full system reboot to get WSL working again: https://github.com/microsoft/WSL/issues/1529. WSL2 Fixes it.

[1] https://emcrisostomo.github.io/fswatch/doc/1.8.0/fswatch.htm... See Freebsd -> kqueue -> Peculiarities

tony··on A Spectre Is Haunting Unicode (2018)
> Following the general adoption of the JIS standards these characters all made their way into Unicode

This is the exact kind of place lost glyphs would find a home. The UNIHAN effort (which spans tons of sources) is very dedicated to cataloging these efforts.

I run a few projects based around UNIHAN, which is geared toward cataloging glyphs that are variants, many of which are archaic and no longer used.

Write up about UNIHAN: https://unihan-etl.git-pull.com/unihan.html

I have a tool to export Unicode's database of CJK characters to CSV, JSON, and so on: https://unihan-etl.git-pull.com/

Python library: https://cihai.git-pull.com/

CLI tool (compare to cjklib [1]): https://cihai-cli.git-pull.com/

No knife / character decomposition. I'm working on it but the data is GPL'd: https://github.com/cjkvi/cjkvi-ids/issues/65

tony··on Ask HN: How does high quality source code from Google looks like?
Go to https://github.com/google, but sort by language:

- C: https://github.com/google?q=&type=&language=c

- C++: https://github.com/google?q=&type=&language=c%2B%2B

- Go: https://github.com/google?q=&type=&language=go

- Java: https://github.com/google?q=&type=&language=java

Google's style guides: https://google.github.io/styleguide/

Hand-picked: https://source.chromium.org/chromium, https://android.googlesource.com/, https://fuchsia.googlesource.com/

Filter by subject: https://opensource.google/projects/explore/featured

Also you can do the same for https://github.com/microsoft and https://github.com/facebook

tony··on Ask HN: Good C++ code bases to read?
C++ build systems will be your main blocker, as they're languages in themselves. Autotools, CMake, configuring Visual Studio/etc.

Easy tasks:

- Challenge yourself by cloning projects reading their README and compiling/running them [1]

- Port projects to other platforms (e.g. Windows-only game examples to Linux/Mac/FreeBSD) [2]

Codebases I've studied [3]:

sdl/graphic widgets: openttd, aseprite, nanogui(-sdl)

runtime / abstraction: v8, node, protobuf, skia

templates / language integration: pybind11, boost-python

wrapping C: libsdl2pp (SDL2 wrapper)

small: tmux-mem-cpu-load, uMario_Jakowski

huge: blender

Architecture / theory: https://aosabook.org/en/wesnoth.html, https://aosabook.org/en/audacity.html, https://aosabook.org/en/cmake.html, https://www.aosabook.org/en/llvm.html

Books: Scott Meyers C++ books

[1] It's C, but to push myself to grok build systems I tried to port tmux's autotools build system to CMake: https://github.com/tony/tmux/compare/master...tony:cmake

[2] https://github.com/jakowskidev/uMario_Jakowski/pull/1

[3] https://github.com/tony/.dot-config/blob/5c59f46/.vcspull.ya...

tony··on LLVM 11.0
Release notes: https://releases.llvm.org/11.0.0/docs/ReleaseNotes.html
tony··on Google and Oracle's decade-long copyright battle reaches Supreme Court
Transcript: https://www.supremecourt.gov/oral_arguments/argument_transcr...

Oral argument: https://www.supremecourt.gov/oral_arguments/audio/2020/18-95...

Oyez hasn't posted it yet, but it'd be up here later: https://www.oyez.org/cases/2020/18-956

tony··on The Rise and Fall of Pret a Manger
If you like this subject, you may like the Company Man on YouTube.

Specifically, they have a playlist for "Company declines" on YouTube: https://www.youtube.com/playlist?list=PL9_9_unNR_e7MU1-fJy9B...

Covers: Kmart, Blockbuster, RadioShack, Toys R Us, Pan Am, Kodak, Sear, Payless, Hostess, Nokia, Quiznos

tony··on Nvidia to Acquire Arm for $40B
Surprisingly - they have a working driver for FreeBSD. Never had an issue with it - and the performance is fantastic. As far back as early 2000's I remember installing proprietary nvidia drivers on Linux and playing UT2004.

Maybe Nintendo/Sony uses Nvidia cards on their developer machines? I imagine FreeBSD drivers aren't simply altruism on their part.

On the other hand, stagnation on other fronts:

- Nouveau (tried recently) is basically unusable on Ubuntu. As in the mouse/keyboard locks every 6 seconds.

- Proprietary drivers won't work with wayland

And since their stuff isn't open, the community can't do much to push Nouveau forward.

tony··on Ask HN: Any good resources for learning Chinese?
I have some CJK tools, but honestly think Pleco (https://www.pleco.com/, as a sibling commenter pointed out) is the best tool available by far. You can add-on as many dictionaries as you like.

I re-launched a website today Chinese Flashcards: https://www.hskflashcards.com/ - navigate cards with swipes on mobile, hjkl and arrow keys. It's in a very early state at the moment, though

- CLI tool for looking on hanzi characters here: https://cihai-cli.git-pull.com/

I split it into library components so you can use the stuff under the hood piecemeal if you do Python:

- https://cihai.git-pull.com/: python library for accessing cjk data

- https://unihan-etl.git-pull.com/ extract data from the Unicode’s Han Unification (UNIHAN) database (https://unihan-etl.git-pull.com/unihan.html)

← PreviousPage 2 of 8Next →