A better Trader has been a work-in-progress project of mine for a very long time. The web UI was done in vanilla javascript, with old school imports, and PHP-style server-generated html, then added jQuery, then bootstrap, then started removing jQuery, then moved towards more-static html with JSON payloads for the data, then pined for better node imports, then then then. You get the point.

I went too long without a rewrite, so I recently became a weekend warrior skeletoning up the next gen web ui. Parts include:

  • Vite due to its blazing hot-loading, tree-shaking, polyfilling goodness
  • React because it’s good enough and gets the job done
  • Bootstrap because I won’t have time to finish the mobile apps for a while

For my UIs, D3 is the most important library there is. So the skeleton is based on responsively displaying a handful of some of Mike Bostock’s greatest hits (imho). This was quite important to me because D3 examples have been somewhat obfuscated when they were migrated to Observables notebooks. The skeleton makes it much easier for me to quickly get working D3 examples by copying Mike’s Observables code into a cozy little container with all the bells and whistles in place.

Let me know what you think of it.

Reddit | Live Demo | GitLab | GitHub | Wiki

Browsers are here to own our desktops. But they will never deliver the absolute horsepower of a natively-coded world-class desktop app or game.

These days, when you try to run one, you will find it is crippled by the browser’s 100 open tabs (admit it, you have that many open…). And lord knows you don’t want to close them all.

I am the user. I am the king. Not the last 20 sites I happened to browse, each of which is allowed to take a huge chunk of our system resources for whatever task they deem important. Once you’ve rabbit-holed down a few holes, you have given your entire system resources to them.

Don’t put up with this. OWN YOUR OWN SYSTEM.

To really take it back when you need to play a game, work in your DAW, or play a 4k video at high frame rate, you need that browser to give up ALL its resources. And in linux, that is super easy.

  • Find the parent browser process pid:
ps ax --forest| grep "[0-9][\_ ]*/usr/lib/firefox/firefox$"
  • “STOP” it. This is the magic that tells linux to just stop serving the parent process and all its children, stripping all CPU allocation from the tasks, without actually closing anything (especially your precious tabs scattered across all your virtual desktops). It’s amazing, it will freeze your browser in its tracks in an instant:
kill -STOP #pid-from-previous-step#
  • Start your powerhouse desktop app and do your thing.
  • When you’re done, you can “CONTINUE” the stopped process, kicking off the CPU to immediately start servicing all that javascript again:
kill -CONT #pid-from-previous-step#

I’ve scripted this up so I can press a media key to “stop” firefox and start up Kodi with beautiful performance. Here’s my javascript “continue” script, which uses my rad-scripts tooling:

#!/usr/bin/env node
import * as rs from 'rad-scripts';
const ffPs = rs.run_command_sync('ps ax --forest| grep "[0-9][\_ ]*/usr/lib/firefox/firefox$"');
const ffProcId = +( ffPs.trim().split(' ')[ 0 ] );
console.log( `Parent firefox pid = ${ffProcId}` );
rs.run_command_sync_to_console(`kill -CONT ${ffProcId}`);

My little iPhone app is simple as I can manage (but no less, ha). SwiftUI is the new way, UIKit is the old way but huge, full of history – can I avoid it? It seems I can. I have login and logout, environment state across pages, tab views, REST API calls with JSON decoding, cookies, page navigation, etc. all working after the second busy weekend of work. And away we go!

I went swimming in the Atlantic for a couple hours. With my Samsung phone in my pocket.

So when I got an updated Android phone, I got an iPhone too. Time for some mobile app development.

(continued…)

Boost 1.77 is working well with it, and I’ve fully migrated to boost::json, which is working out great. The straw that broke the camel’s back was map.contains(), lolz. I was ready! I feel like I’ve had a hot bath. Nice.