Better HN
topnewbestaskshowjobs
Log inSign up

CodeIsTheEnd

923 karma · joined Feb 28, 2021 (5y ago) · 80 submissions

twitter.com/CodeIsTheEnd

Projects:

- plaintextsports.com: Live scores, play-by-play and box scores, in plain text. No images, no ads, no tracking, and no loading. (Also twitter.com/PlainTextSports)

- jless: A command-line JSON viewer written in Rust. (jless.io)

Submissions

comment 4y ago · link · parent

EDIT: Wilfred IS the original author [3]; my apologies.

Not to discredit Wilfred (it looks like he's taken over the project as the maintainer), but, based on the historical contributions [1], it looks like it was originally developed by Max Brunsfeld, who also created Tree-sitter. [2]

[1]: https://github.com/Wilfred/difftastic/graphs/contributors

[2]: https://github.com/tree-sitter/tree-sitter

[3]: https://github.com/Wilfred/difftastic/commit/958033924a2dea7...

comment 4y ago · link · parent

I sure do! Knock if you ever want some stickers!

comment 4y ago · link · parent

Hey, HN! Creator here!

I started building Plain Text Sports last year when I was watching an NFL playoff game in rural southwest Wisconsin. We had poor TV reception -- the image was going in-and-out -- and the local radio station was mostly static. I tried to check ESPN, but the loading bar was as frozen as the ground outside. I then had the idea for a website designed for the pure sports fan: no ads, no images, just scores, play-by-play and stats, with a simple information-dense display.

I initially added support for the NBA so I could follow my beloved Milwaukee Bucks. I posted it to /r/nba, got over 600 upvotes in a few hours, and got perma-banned for self-promotion. (I did a Show HN too, but it didn't take off. [1]) Over the following months I added NHL, MLB, NFL, college basketball and football, and added standings and team schedules so it could really be a one-stop-shop for my sporting needs. Just this past month I added MLS and NWSL (National Women's Soccer League). I plan on adding the WNBA and the Premier League later this year too.

Obviously I designed the site with minimalism and efficiency in mind, as a reaction to the bloated web we see today. We don't need heaps of JavaScript just to display a bit of text, nor do we need half-a-dozen sites tracking our "engagement", and our "retention". People just want to get the information they're looking for, as fast as possible. Technology shouldn't get in the way.

Despite the austere presentation, I'm really proud of the design of the site. As a commenter noted, it's not actually plain text, but does use some CSS and a tiny bit of JavaScript (sue me!). But there are a lot of small details that I put a lot of effort into: the game times on the front page automatically show up in your local time zone, and the boxes automatically expand to fit long time-zones. For the NBA, the raw play-by-play data I get is very granular. A steal, for example, is both a turnover by the offensive player, and a steal for the defensive player, but I combine those into a single event in the timeline. For the NFL, I draw an ASCII drawing of the field showing the progress of the most recent play [2]. When a team wins a championship, they get an ASCII trophy and a dedicated spot on the front-page for the next week. It's been really fun trying to figure out how to pack as much information as possible into a 45 column-wide display.

A streamer I watch on Twitch [3] who does marketing at Nvidia also had a competition amongst his viewers to make their own ads, and that led me down another rabbit hole of fun "plain-text" videos. [4][5][6].

Plain Text Sports also led to my next project. I get a lot of data from publicly accessible, but undocumented JSON APIs, and it was frustrating digging through giant JSON files trying to understand how certain situations were represented. That led me to build jless [7], a command-line JSON viewer, which made it to the front page last month.

[1]: Original Show HN: https://news.ycombinator.com/item?id=26310314

[2]: ASCII football field: https://twitter.com/CodeIsTheEnd/status/1436003783327293452

[3]: Atrioc, Nvidia marketing streamer: https://twitch.tv/atrioc

[4]: Never Miss Moment Ad: https://www.youtube.com/watch?v=9t1qY0vOJWc

[5]: Bucks Championship Run: https://www.youtube.com/watch?v=4WHcP4PTBHY

[6]: Wisconsin Sports Ad: https://www.youtube.com/watch?v=dLsm0MirOEg

[7]: jless, a command-line JSON viewer: https://jless.io

comment 4y ago · link · parent

Is there a WYSIWYG (what-you-see-is-what-you-get [1]) document editor that is built on a foundation of HTML/CSS, and explicitly surfaces operations that map to CSS features, like flexbox? Changing the base style just means writing CSS rules for the `p` tag! And it could maybe even encourages component / class-based styling? I imagine it could be used for creating things that may get printed out, but will also see a longer life on a web page. You could even have explicit media queries to apply only when printing! [2]

I think of something like creating a good looking resume, which may include light graphic design elements like divider lines, and might not have a strictly linear layout and put some information in a sidebar. Making something look good in Word can be really frustrating, and require jiggering with margins and column layouts. It may fall apart when you try to add a new job. It's almost a joke that if you want a good looking resume, you should use LaTeX, but that's incredibly inaccessible. So many more people know basic HTML and CSS!

I think a lot of website builders (like Webflow [3] ?) expose a lot of underlying HTML/CSS, but I suspect they also support a lot more ad-hoc graphic design elements that can really make the underlying HTML document a total mess.

[1]: https://en.wikipedia.org/wiki/WYSIWYG

[2]: https://developer.mozilla.org/en-US/docs/Web/CSS/@media#prin...

[3]: https://webflow.com/

comment 4y ago · link · parent

Guilty [1]. But it's really hard to handle both light and dark color themes! On a dark terminal you're probably more likely to use the "Bright" variants when using the default 16 color palette, but then you'll have less contrast in a light theme. Some color schemes intentionally invert the "bright" colors and makes them darker for a light colored scheme. This is what Gruvbox [2] does, but most other palettes don't. I also have an issue with Solarized which makes some of the Bright colors almost exactly the same as the foreground or background, which can make text printed in certain colors seem invisible.

I've used ANSI codes to invert colors (which works pretty well for highlighting), and dim colors, but those can't solve everything.

[1]: https://github.com/PaulJuliusMartinez/jless/issues/4 [2]: https://github.com/morhetz/gruvbox

comment 4y ago · link · parent

(Author here) Homebrew support was added entirely with macOS in mind, but Homebrew for Linux uses the same repository of formulas as Homebrew for macOS [1], so you get Linux support for free. I included Homebrew for Linux because it's an option, but I don't want it to be the only option.

I guess I should explicitly say in the documentation that help would be appreciated in adding support for other package managers. I definitely want jless available through the most standard avenues.

[1]: https://github.com/Homebrew/homebrew-core/blob/master/Formul...

comment 4y ago · link · parent

Oops, sorry, I haven't actually made a new release with those commands yet. I'll need to have better discipline maintaining a separate `latest` branch for the website...

comment 4y ago · link · parent

Sorry! Someone already filed an issue about this [1], but I haven't had time to investigate exactly what is appropriate to put there. I don't use Linux, nor have I ever released and distributed open-source software before, so I'm just kinda guessing here -- other people have added the project to various package managers, not me.

Installing via Linux Homebrew is simply listed as an option because it's available as a Homebrew formula. And the option to install via cargo is also noted.

[1]: https://github.com/PaulJuliusMartinez/jless/issues/46

comment 4y ago · link · parent

Author here! When I originally submitted it, it didn't get a lot of traction (it got on the front-page via the second chance pool a couple days later), and I definitely regretted not including "written in Rust" in the title. I'm acutely aware of HN's love of Rust, and the subsequent grumbling about always bringing it up that something is written in Rust, so I left it out with the false illusion that not mentioning it would make it more "pure" or something.

But I was also pretty confident that I made something useful, and, in hindsight, I don't think I should have preemptively felt bad about using some "cheap" form of marketing to get people to see it. I have really conflicting thoughts about marketing and self-promotion from my experience trying to show people my other project, plaintextsports.com [1] (live sports scores in plain text with no ads or trackers so it loads instantly! I think the HN crowd would love it!). There's a weird line between marketing and advertising and self-promotion, where one is "ok", but the other is frowned upon. It's also a tale as old as time that the better marketed but technically inferior product wins out. (AC vs DC initially, Betamax vs VHS!) How much of success is being brazen enough to ignore those norms and shamelessly promote something? Should it be considered shameful to promote it in the first place?

In this case, being written in Rust is definitely a feature, as least when comparing tools! fx [2], a similar tool that made the front-page a couple months ago runs using Node, and I'm sure jless can handle bigger files and uses less memory (though admittedly I haven't actually verified this).

[1]: https://plaintextsports.com

[2]: https://news.ycombinator.com/item?id=29861043

comment 4y ago · link · parent

This reminds me of a very poor interview question I asked a couple of times (and then never asked again because it is a terrible, terrible, interview question).

The snake cube puzzle [1] is a puzzle where you have to fold up a string of 27 cubes, with fixed "turns" like the shapes in the OP, into a 3x3x3 grid.

The goal was not to find a solution to the puzzle, but to find the smallest 2d area the snake could fit into without folding against itself. It turned into a modeling problem (how do you represent the puzzle in code?) and a recursion problem (try all possible folds), but, uh, even with a physical puzzle to play with, it was a little too abstract

A commenter on the link below asked another question over 13 years ago: can the puzzle be folded into a plane without any holes? Obviously if you just lay out the puzzle from end to end it will be in a plane, and without any holes, so maybe the question should be: what is the smallest 2d area the snake can fit into without creating any holes?

[1]: https://mypuzzles.wordpress.com/2008/09/07/the-snake-cube/

comment 4y ago · link · parent

I browsed Fiverr to find a few artists whose styles were similar to what I had in mind, then messaged a few of them. annatgraphics [1] was able to take my crude color pencil sketches and turn them into the slick art you see today!

[1]: https://www.fiverr.com/annatgraphics

comment 4y ago · link · parent

Thanks to the both of you! plaintextsports was my real passion project over the past year (probably 3x more time spent on it than jless!), so I really appreciate it when other people find value in it. I'm a Milwaukee Bucks fan and building a site explicitly so I could follow the team more easily certainly made winning the championship more personally meaningful.

comment 4y ago · link · parent

Yup, someone already made a PR for to add these! It turns out the behavior is pretty subtle in terms of how it handles count arguments (it's actually stateful!), and where the focus moves. I'll take some time to figure out how to exactly match the vim/less behavior, but that should be coming soon!

I'm more of a ctrl-e/ctrl-y guy myself, so I didn't feel a need to implement these commands right away.

comment 4y ago · link · parent

That's certainly the plan! I've never released a project like this, so I wasn't sure what the process is for adding things to Homebrew, or other package managers. A few people have been really helpful and already added it to Arch Linux and NetBSD's package managers.

This week I just wanted to get the project out there to see if people liked it, so I compiled stuff locally and manually uploaded them to the GitHub releases page. I'll spend some time over the next few weeks figuring out how to automate a lot of these things.

45.

Show HN: Jless, a command-line JSON viewer(pauljuliusmartinez.github.io ↗)

344 points · by CodeIsTheEnd · 4y ago · 84 comments

46.

Webhook.site – Test, process and transform HTTP requests and emails(webhook.site ↗)

3 points · by CodeIsTheEnd · 4y ago · discuss

comment 4y ago · link · parent

Anything longer than a few sentences I'll write in vim and am always horrified when I copy to Gmail or Google docs and find spelling mistakes, duplicated words, and incomplete sentences everywhere.

comment 4y ago · link · parent

This is incredible! While just controlling the soprano, it does the voice leading for all the other voices and composes together actual chord progressions. I don't have a good enough ear to determine whether it actually stay in the same key, but I could definitely hold it on a dominant chord and then it would resolve to the tonic as I moved. I even heard a suspension thrown in there!

comment 4y ago · link · parent

Previously discussed (66 comments) just a few months ago:

https://news.ycombinator.com/item?id=28298729

comment 4y ago · link · parent

I recalled this project / paper while reading the comments on "DeepMind’s New AI with a Memory Outperforms Algorithms 25 Times Its Size" (https://news.ycombinator.com/item?id=29645887).

The many iterations of TCP congestion control algorithms (Tahoe/Reno/NewReno/Vegas/BIC/CUBIC) all rely on pretty hard-and-fast rules for detecting congestion and anticipating certain failure conditions, but these are limited by our ability to parse patterns from complex emergent behavior and reduce those to rules that, at least on some level, "make sense".

This project, Remy, keeps track of three variables: - exponential-weighted moving average of interarrival time of acknowledgements - exponential-weighted moving average of time between sender timestamps - ratio between most recent round-trip-time (RTT) and the minimum RTT seen

From these three variables it generates an "action", which is really three parameters that are plugged into a simple rule to determine whether to send more packets. The three parameters are: - A multiple m of the current congestion window - An increment b (possibly negative) to the congestion window - A lower bound r > 0 on the time between sending segments

If the window isn't full, then the algorithm will send more packets, but not more frequently than r units of time. And Remy will occasionally update its action based on new data.

The key then is that Remy generates different actions for different input state variables, providing different behavior based on the observed state of the network in a way that's orders of magnitude more fine-grained than any human written algorithm. (I think these lookup tables are generated offline; not sure if they can be adjusted while running.)

51.

TCP Ex Machina: Computer-Generated Congestion Control (2013)(web.mit.edu ↗)

1 points · by CodeIsTheEnd · 4y ago · 1 comment

comment 5y ago · link · parent

Wow, this is a really great article. Thank you for sharing!

It discusses a fascinating point about browser UI: when the browser displays something inside its chrome, where a malicious page could render arbitrary pixels, it must establish a visual bridge back to the "trusted zone" (the chrome), providing proof that is in fact trusted content.

(The author points out that new APIs allowing writing to the entire screen means it's hopeless and we're all doomed though.)

comment 5y ago · link · parent

And if you want an increasingly slower bash startup, you can add the following to your coworker's .bashrc/.bash_profile if they keep forgetting to lock their screen when they go to grab a snack:

    echo 'sleep 0.01' >> ~/.bashrc # or ~/.bash_profile

comment 5y ago · link · parent

TIL: Chrome DevTools Layers tab, accessible by going to to the three-dot menu > More Tools > Layers, which allows you to see things rendered outside of the browser viewing area (among many other things I'm sure).

If you have something that "unmounts" things as they scroll off the screen ("virtualized rendering" as the article calls it, a common feature for data grids), this is great tool for verifying that behavior.

comment 5y ago · link · parent

Blind mode is great! It'd be cool to be able to see the entire tournament bracket at the end -- I can only see the font that won, but the others were pretty close. I want to see when the font I normally use got knocked out.

Also, for really maximizing utility, it'd be cool to add variations of the same font but with different line-heights. I definitely voted against some fonts because they appeared "squished", but maybe a bit bigger line-height would make me prefer it.

comment 5y ago · link · parent

Two things:

1) I recently implemented truncating long lines for CLI tool and went with a hybrid approach using both graphemes and virtual columns -- I'd only truncate a line between graphemes, but when counting how much space was used up I would use virtual columns. In the case of something like , this means things tend to error on the "safe" side of truncating a line too early if the virtual column approach counts it as 4 columns wide rather than 2.

2) I wanted to test something with the scientist emoji and managed to crash Ruby's repl, irb, simply by pasting it into the repl and then backspacing over it. (It was clearly confused about the position of the cursor, and the stacktrace pointed to an error in a line_editor.rb file.) I was on Ruby 2.7.1, but it looks like it's been fixed in 3.0.0!

comment 5y ago · link · parent

Work on esbuild started at the start of 2020. It is primarily authored and maintained by Evan Wallace, who, in addition to making this tremendous contribution to the JavaScript ecosystem, is the CTO and co-founder of Figma. Incredible output.

comment 5y ago · link · parent

Directly related to dithering and compression, Return of the Obra Dinn is, to an certain extent, an "unstreamable game".

When this streamer on Twitch tried to play it [1], the quality of his composited webcam would immediately drop as the compression algorithm focused on rendering the high-frequency dithering sections of the screen. As soon as he would aim the camera away from the fancy rendering (to the sky for instance, or the menu), the video quality would immediately improve. Really a fascinating clip.

[1]: https://imgur.com/S191sI0

Here's a thread of someone complaining about it on Reddit:

https://www.reddit.com/r/Twitch/comments/ls06j5/the_unstream...

comment 5y ago · link · parent

I don't understand why GitHub hasn't solved the issue of diffs starting with a '}' (or ')' or 'end'). Just slide the diff over while it starts with a closing token! I suppose it's an artifact of the diffing algorithm, but aren't there better diffing algorithms, even built-in within git?

This is by far the most obvious example of "git doesn't understand programming languages", but it also seems like the most straightforward to fix.

123