Better HN
topnewbestaskshowjobs
Log inSign up

qbasic_forever

10,505 karma · joined Feb 3, 2021 (5y ago) · 2,505 submissions

Submissions

comment 5y ago · link · parent

JQuery document ready handler that makes a XMLHttpRequest and then a pile of jquery DOM manipulation calls to make the DOM state reflect the data you just got back from the server. Basically just a lot of imperative DOM manipulation calls. No templating, no MVC patterns, etc. This is the kind of frontend JS that was all over the web in the early 2000's.

comment 5y ago · link · parent

I'm surprised more folks haven't made the connection that the chip shortage is causing drastic changes to manufacturing like this. Some new trucks have gotten rid of their navigation systems, backup cameras, etc. because they can't source the chips: https://www.bloomberg.com/news/articles/2021-05-06/chip-shor... Things are getting somewhat dire for manufacturing.

comment 5y ago · link · parent

> Can you think of anybody who makes real money selling deep dives on the web?

It can be done on a small scale. The name escapes me but somebody big in the React world recently put out a course and made well over 5-6 figures in the first day of preorders alone.

Now whether that scales to fund an entire organization or corporation remains to be seen.

comment 5y ago · link · parent

Imagine a dystopian future where you google something like "document queryselector API" and now have to ignore both of the top two hits from W3Schools _and_ MDN as useless spam-filled low content sites.

shudder

I hope we don't go down that road...

comment 5y ago · link · parent

Nobody would donate to the CEO and board's salary though, and that's the unfortunate problem.

comment 5y ago · link · parent

Text file in a github repo, seriously.

comment 5y ago · link · parent

Yeah hugo kind of suffers from being one of the first popular tools in the SSG space. It's been around for a while and feature creep has definitely added to the complexity. Being written in Go is both a huge advantage, and an unfortunate disadvantage too these days.

It's great because the speed and ease of use is unrivaled, but nowadays a jamstack site is much, much more than just a pile of markdown turned into HTML. People are building complex SPA, SSR, hybrid, etc. architectures and using fancy webpack-based workflows with all kind of transpilation, code generation, etc. at every level. You have to jam all of that into hugo's workflow and it just adds to the complexity--now you need a full node/JS frontend setup (with webpack/babel/postcss/etc.) and hugo's setup on top of that. Hugo tries to do some of this itself with esbuild but it still is hard to get away from bolting on webpack with hugo and getting the best... and worst... of both worlds.

comment 5y ago · link · parent

Yeah asciidoc is pretty slick. I wish pandoc had more love/support in the SSG world as it can handle basically every doc format known to man with ease, and even enable fancy logic with AST filters in lua scripts. Why not use md, asciidoc, rst, etc. wherever you want.

My dream setup would be something with simple file-based routing like MkDocs, all of the rendering formats and power of pandoc, and the ease of deployment and speed of a Hugo-like static binary in Go (just one exe and you're done).

comment 5y ago · link · parent

I've been exploring a lot of these tools recently and it seems like there are two ideologies. Hugo, and many others in the jamstack/SSG space, are basically full-fledged content management systems. These come from a long line of tools all meant to basically replace Wordpress in a content-focused workflow. This means they support a lot of bells and whistles with document schema (categories, tags, site maps, etc. etc.) and taxonomies. There are even workflows like draft posts, setting future publish dates, etc. (again very Wordpress inspired). You could build a recipe collection site just as easily as a technical documentation site with hugo for example.

On the other end of the spectrum you have tools like MkDocs (or mdbook, docsify, docusaurus, etc.) which are more focused on technical docs in markdown format. These tools put much less emphasis on schema, layout, taxonomy and really try to go from a pile of simple markdown files to a rendered site with as little friction as possible. You typically just lay out files in the filesystem, make simple markdown links between files, and the tool takes care of all the details of building a doc site like layout, rendering, linking, table of contents, and even search.

The big tradeoff between them is complexity. There's a _lot_ to learn to fully use something like hugo. You can spend days going through all of its features and building complex asset processing pipelines, themes, taxonomies, workflows, etc. But this is also a bit of a downside if you just want to turn some markdown files into simple technical docs--you have to do a bit of organization, add frontmatter, and learn a few hugo quirks. You'll have a fancy base to really go wild and add tons of content... but for technical docs you might not need all that power and complexity.

MkDocs strikes a really nice balance in this regard--you basically just write markdown files with simple links and it will figure out the rest. The Material theme here is _very_ slick and one of the best out of the box themes you'll find for any technical docs generator (or even SSG in general) period. This combo is so good Spotify use it heavily in their developer portal system Backstage: https://backstage.io/blog/2020/09/08/announcing-tech-docs That's a pretty strong endorsement IMHO.

comment 5y ago · link · parent

Dropbox is big enough that they could just acquire Oxide now before they even get to market. That might even be the plan all along. I can't imagine there are more than like a dozen companies that are their target market, i.e. big enough to need Facebook-level datacenters but not big enough (yet) to have that engineering team.

comment 5y ago · link · parent

Your employer's group policy controls, management agents, etc. that control access to their internal network can (and are) already telling them all of that information. They're basically rootkits that run anything they want on computers that access their network. Usually they just distribute certs, keys, etc. or remotely wipe a lost/stolen machine, but the capability is there to do anything.

comment 5y ago · link · parent

Not in the videos where he tastes 50 year old coffee beans someone found in their attic. :)

comment 5y ago · link · parent

Somebody needs to invent a coin that works on proof-of-carbon-emission-reductions, or proof-of-global-poverty-reduction and do some real good for the world.

comment 5y ago · link · parent

esbuild does transpiling too, for example it can pull out typescript annotations or handle JSX transforms. It doesn't support transpiling down to ES5 though like swc. In general both tools are pretty similar, when you get down to it they're just a class of tool to take JS code, produce a AST, and then perform various transformations to the AST and write it back out as JS.

comment 5y ago · link · parent

esbuild is perfect for adding to a go server app that needs to do some basic bundling. Just add it as a go module dependency, add a few go generate comments to use it to bundle your JS code, and you're done--you don't need nodejs or anything else installed.

comment 5y ago · link · parent

I am genuinely curious, what do you think is the end game of this apparent conspiracy by browser creators to reduce the intelligence of users through simplified user interfaces? They will convince them to buy more things... somehow? And that benefits the browser creators... somehow?

comment 5y ago · link · parent

They already did the extinguish thing when they killed Google Reader to try to prop up the failing Google+ network. RSS never recovered from that inflection point. I'm still mad.

comment 5y ago · link · parent

I don't see that bug on Firefox (version 88, linux amd64). It slides out as I scoll down and stays hidden when I stop scrolling. It only comes back into view when I scroll up.

edit: Are you scrolling with a janky mouse wheel or multi-touch trackpad that might be triggering up events accidentally? It looks like your page jerks up a teeny bit from momentum when you stop--that's probably the issue.

comment 5y ago · link · parent

I really liked this zine by Julia Evans: https://jvns.ca/blog/2020/11/22/new-zine--hell-yes--css-/ It helped me get over the hump of realizing most modern CSS is a very simple and clear subset of all CSS. I.e. don't get bogged down in legacy or browser specific quirks and eccentricities--stick with modern conventions like flexbox, grid, etc.

comment 5y ago · link · parent

There's no generic HTML import function yet. Right now you can only have a page pull in javascript (through a script tag or ES module import) or CSS files, but critically not component HTML files. So it's hard to have a component defined by HTML and CSS that can be shared and imported in other pages. There's no "grab this HTML page and give me the DOM to insert/clone/use how I please" in pure HTML. The closest thing is iframe but it's not really a general component tool. For better or worse JS is currently the way to share logic and fragments between HTML pages. There was a working group looking at HTML imports but I think it all got spun down.

comment 5y ago · link · parent

No, a web component by definition must be a class that inherits from a HTMLElement base class and implement some basic rendering functions. In addition you must make the browser aware of the component by calling a CustomElementRegistry.define function with your class and the desired component name. So at a minimum there's about 5-10 lines of boilerplate JS necessary to define and register a basic component.

comment 5y ago · link · parent

There was a strange time in the dark days of IE6 dominance 20 years ago that you actually could write page scripts in non-javascript languages. VBScript was a big option that some people used, and IIRC there was a way to get python support in IE (and Windows) script host too. When I was first learning Javascript in ~1998 I remember all the docs showed how to do stuff in both JS and VB script tags: https://stackoverflow.com/questions/17483782/vbscript-suppor...

comment 5y ago · link · parent

Exactly! Yeah I have dozens of tabs open and never fear restarting the session. Hats off to the dev that implemented it--it's a really well thought out and implemented feature.

comment 5y ago · link · parent

Yeah I've been relying on this for about a year and have been really impressed. It's the first restore browser session I've ever used that just works. I never get "oops corrupted session, start over!" errors, etc like I used to get with chrome. Everything just fires back up with all the tabs, all the extensions, even all the different browser windows I had before. And it handles ungraceful shutdowns/restarts really well (which sadly are far, far too common on this early generation Ryzen APU laptop and the current mainline Linux kernel :( ).

comment 5y ago · link · parent

Yeah that's the core idea with all code notebooks like Observable or Jupyter, etc. You get instant feedback and results right in the notebook. So you type some code, usually press a button to run, and instantly see the results right next to the code. It would be kind of like if your traditional IDE had a run button that compiled, ran, and dumped the output of your in development program as comments right below the lines you're editing.

comment 5y ago · link · parent

Three laptops on the same wifi router all talking to each other at once can be very problematic, especially if it's an inexpensive consumer router with one radio. Only one device can shout into the wifi ether at once and the protocol has backoffs to make sure multiple devices don't clobber each other by talking at the same time. Add on top of that other backoff strategies in higher level protocols like in TCP and you can have abysmally slow connections for anything.

comment 5y ago · link · parent

It's running on localhost here and I presume that's their intended use case for this feature. Localhost is critical for development--imagine if VS code wouldn't work unless you were connected to Github.com. This is fixing that issue with observable notebooks so now you can run and develop your notebook locally without depending directly on the internet or their cloud service.

comment 5y ago · link · parent

It's an observable notebook: https://observablehq.com/ Basically a notebook where you write JS code and see the results immediately rendered in the notebook. In this case it's being served locally instead of requiring you to use their service website. If you've ever used Jupyter or IPython this is very similar (code notebooks) but with some interesting changes in philosophy and more of a Javascript implementation instead of python.

What might be tripping you up is that in this demo the observable notebook isn't showing the code cells, only the outputs. The code is in the editor on the left and the output on the right is the result of running the code as an observable notebook. In some ways it is like a simple interactive web app.

comment 5y ago · link · parent

I like the ipython-sql magic in Jupyter: https://github.com/catherinedevlin/ipython-sql Depending on what you're doing you might be able to get away entirely with just using it and some basic queries, i.e. no python glue code in the notebook at all. But worst case you might need a cell to open up the DB connection and make the magic aware of it, then you can execute clean and simple SQL queries in cells using the magic.

comment 5y ago · link · parent

Why not just use an OCI container and runtime (docker, containerd, crun, etc) or even systemd-nspawn?
1
707172
84