HNHacker News
TopNewBestAskShowJobs

tomatsu

377 karma · joined July 27, 2016

submissionscomments
tomatsu··on How to Get 100/100 Google Page Speed Score with Middleman and Nginx
> I'm curious if brotli's decompression is still fast on high compression levels. This is the case for gzip IIRC.

Yes, it's optimized for fast decompression. Compression, on the other hand, is comparatively expensive. This trade-off makes Brotli very interesting for static assets.

https://quixdb.github.io/squash-benchmark/

tomatsu··on How to Get 100/100 Google Page Speed Score with Middleman and Nginx
You could use a cookie which contains the revision and then the server could selectively push things which have changed since then.
tomatsu··on ES7 brings two new features
Too bad it was renamed. "Contains" was a much better name.

"Contains" is used everywhere else - the DOM API included (Element.classList.contains).

tomatsu··on 150 days of living and coding in a van
> Why would any sane person leave the water running while brushing their teeth?

Because turning it on and off all the time is inconvenient.

Operating the faucet with a foot pedal fixes this. People are too lazy to push it down if they don't need water right now.

With a pedal, you can also turn the water off in the middle of washing your hands. It's like a small-scale navy shower.

tomatsu··on ThinkPad Anniversary Edition 25: Limited Edition ThinkPad Goes Retro
Fn and Ctrl are the wrong way around.

My laptop also got pgup and pgdn in those position, but they have a slightly different shape than the up key. I flipped them with Home and End with seems to be a somewhat popular thing to do. Works much better for me.

The 1920x1080 resolution is a bit disappointing. Crispy text needs more DPI.

tomatsu··on How a ’50s-Era New York Knife Law Has Landed Thousands in Jail
> I believe that any knife that can be opened one handed would qualify, no?

This would include things like box cutters (utility knifes).

tomatsu··on US bans Kaspersky software in federal agencies amid concerns of Russian spying
And the US doesn't?

By the way "propaganda" and "public relations" are exactly the same thing.

tomatsu··on AdNauseam – Clicking Ads So You Don't Have To
> 2Kb of extra bandwidth

Images, animations, auto-playing videos... ads are much larger than 2KB. 2KB for the network overhead alone, maybe.

Anyhow, my primary reason for blocking ads is that I seriously hate animated stuff next to text I want to read.

tomatsu··on Woman Banned from US After Border Agent Finds Proof of Drug Use on Phone
https://www.reddit.com/r/FloridaMan/
tomatsu··on What's the deal with Ctrl+Left and Ctrl+Right?
Komodo Edit/IDE had some command for selecting the word which is touched by the cursor (|foo, f|oo, foo| -> would select "foo"). It's similar to double-clicking a word. I used Ctrl + Shift + Down to activate it.

Too bad it isn't a standard thing. I liked it a lot.

tomatsu··on Steadying the Mouse for People with Parkinson's Disease and Multiple Sclerosis
> 9px Verdana

It's 9pt, but I do agree that it's way too small. I got the zoom level at 150% even without having any disabilities.

tomatsu··on Why Germans pay cash for almost everything
Paying with cash is faster.

Inserting your card, entering your pin, waiting a bit, getting some receipt printed, and finally signing it does take significantly longer than getting the right amount of change from a cashier who is used to doing this.

Paying with a debit card always makes you look a bit like a twat. It's similar to paying with a handful of coins.

tomatsu··on Detecting Chrome headless
> var body = document.getElementsByTagName("body")[0];

You can just use document.body.

I also suggest to use a data URL instead. E.g. "data:," is an empty plain text file, which, as you can imagine, won't be interpreted as a valid image.

  let image = new Image();
  image.onerror = () => {
    console.log(image.width); // 0 -> headless
  };
  document.body.appendChild(image);
  image.src = 'data:,';
> In case of a vanilla Chrome, the image has a width and height that depends on the zoom of the browser

The zoom doesn't affect this. It's always in CSS "pixels".

tomatsu··on Facebook employee is homeless, lives out of her car
Yea, I wouldn't mind living in a large fancy RV. There are apartments which feel more cramped.
tomatsu··on URLs are UI
The 'x' (#cancel-copy) does nothing. You've to focus/blur #link to go back.
tomatsu··on The capital sharp S in now part of the official German orthography
> how do I type this?

On Linux, capslock then ß works. No idea how to do that on Windows, though.

> so the only reason to use it is to write a word in ALL CAPS.

Yep, it was only added for ALL CAPS. It was actually added to Unicode back in 2008.

https://en.wikipedia.org/wiki/Capital_%E1%BA%9E

IMO it makes sense that it exists. ß -> SS -> ss is a lossy transformation.

tomatsu··on Smog in our brains
> We should really ban big diesel rigs from areas with population density above a certain threshold.

I'd go much further than that. I'd ban all combustion engines in cities.

There are enough alternatives: Walking, bicycles, ebikes, trams, electric buses, trains, and electric cars.

We should try to keep the air as clean as possible in densely populated areas.

tomatsu··on Google’s Flutter = React and Java Swing
> Dart? [...] JS fatigue

I think you might like working with Dart. The entire ecosystem is standardized. And if you do Flutter stuff, Flutter is the only framework.

Learning the language isn't a big deal. You already know most of the syntax and its semantics are straightforward.

You can try doing some Hello World stuff over at DartPad:

https://dartpad.dartlang.org/

tomatsu··on Powerful New Additions to the CSS Grid Inspector in Firefox Nightly
Having the dev tools integrated means that they are still available if you're using some machine (e.g. a school PC) where you cannot install extensions.
tomatsu··on America’s new tobacco crisis: The rich stopped smoking, the poor didn’t
I quit cold turkey and ate 2 large bags of sunflower seeds in the first 3 weeks. Quitting was cheap.

Quitting isn't that hard. It's just super annoying.

Things like exercising regularly and eating properly take more discipline and willpower, for example.

tomatsu··on WebAssembly 101: A developer’s first steps
You do get near-native performance, though.

There are benchmarks. You can run them yourself.

tomatsu··on Exploring Flutter for Cross-Platform Mobile Development
Either the IDE/editor is able to assist you or you have to consult the documentation regularly.

That's just how it is.

JS' standard library, for example, is really tiny but I haven't memorized all of it. If the editor can't clue me in, I have to check the docs.

tomatsu··on Exploring Flutter for Cross-Platform Mobile Development
> The web is the web, there is only the DOM guys, deal with it and move on.

Flutter doesn't use a WebView. There is no DOM.

That's why it's fast.

tomatsu··on Exploring Flutter for Cross-Platform Mobile Development
> Why do I need to care if something takes a `child: (single object)` argument or a `children: [LIST of objects]`?

The IDE tells you what's needed and the latest version of the plugin automatically adds a list literal and places the cursor inside it:

https://groups.google.com/forum/#!topic/flutter-dev/LXafJQqS...

Personally, I think it makes sense to differentiate between exactly one and zero or more.

> Why do I need to memorize which objects take which styling arguments?

The IDE should do that for you.

tomatsu··on Asm-Dom – WebAssembly Virtual DOM
> let, const are slower than var, for example.

They aren't slower anymore in V8. Most ES6 features are now about as fast as their ES5 counterparts.

tomatsu··on Official list of phoned-home info revealed by Microsoft
Xubuntu (with xfce instead of Unity) doesn't have that kind of thing. After you've moved panel #0 to the bottom, it's much closer to Window's UI as well.
tomatsu··on Fuchsia: a new operating system
AOT compiling was initially all about iOS (where JIT isn't allowed), but you can now do that everywhere with "application snapshots" which were recently added with Dart 1.21.

Unlike the script snapshots, application snapshots also include CPU-specific native code in addition to the serialized token stream of the source code.

So, you don't just skip the parsing stage, you also skip the warmup phase. Your application starts instantly and it runs at full speed from the get-go.

https://github.com/dart-lang/sdk/wiki/Snapshots

tomatsu··on With a 10-day supply of opioids, 1 in 5 become long-term users
Benzos are only used for short-term treatment of anxiety. You get withdrawal symptoms after taking relatively small dosages for a few days. There are also many adverse effects like being unable to retain any new information. E.g. when I briefly took them, I was unable to memorize a 4-digit pin. I gave up after 15 minutes. I couldn't do it. It was terrifying.

Benzos are pretty terrible. That second doc did you a favor.

The only somewhat useful advice I have to offer is to quit smoking if you do smoke. Smoking increases the base anxiety level quite a bit.

tomatsu··on To www or not www
I always thought it was odd when they go with the whole "http://www." voodoo ritual, but then they skip the final slash after the domain.
tomatsu··on Ask HN: Will front end development ever move away from JavaScript?
TypeScript and Dart are viable options for scripting. (Try it!)

Wasm modules will be viable options for processing-intensive tasks.

← PreviousPage 2 of 5Next →