HNHacker News
TopNewBestAskShowJobs

szhu

763 karma · joined March 17, 2014

https://github.com/szhu
submissionscomments
szhu··on K-Stash: A search engine for your useful links – for devs and researchers
It looks like people are discussing alternatives here, so I wanted to give a quick pitch for my setup.

I stash my useful links in Asana. For those who haven't used it, Asana is like a big, organized to-do list. Each link I want to keep becomes an Asana task. I can organize them the Asana way, using tags or projects (task lists), or I can just put useful words in the description so I can search for them later.

Asana probably wasn't built for this use case, but it works pretty darn well. My most important workflow is being able to send the current webpage I'm reading to Asana using just a few taps, and Asana supports that easily -- the official Chrome extension is specifically for doing this, and the Asana apps support the Android and iOS share integrations.

In addition -- and this is important too -- I feel pretty confident that Asana (and thus my data) will still be around in 5-10 years. I'm not sure if I can say that about almost all of its competitors.

Note: I'm not affiliated with Asana. I'm familiar with Asana because I used it at work, but other to-do apps might also work for bookmarking. If you have one in mind, let me know in the replies!

szhu··on Ask HN: I want to make school more afforadable
Don't have groups/projects I know about, but if you'd like, I would love to have a further conversation about education. I'd rather converse rather than post because most of my thoughts are still half-baked (and because I have quite a lot of thoughts about education). Feel free to contact me through the link in my bio.
szhu··on Animals Use Social Distancing to Avoid Disease
I have a friend with pet rabbits -- apparently this is common in most prey animals.

Individuals won't indicate that they are sick unless there's a statistical advantage to doing so. Non-social animals don't get help from their peers, and traveling birds can't help their weak peers fly even if they tried.

szhu··on Portals API
Found some context: https://github.com/WICG/portals

I think this proposal is a better starting point for readers than an API spec.

Goals, taken directly from the proposal:

- Enable seamless navigations from a page showing a portal, to the portaled page

- Enable seamless navigations between pages of a portal-aware website

- Avoid the characteristics of iframes which have negative impacts on security, privacy, and performance

Also: https://github.com/WICG/portals#summary-of-differences-betwe...

szhu··on Apple Music on Android requires its own payment details to avoid Google 30% cut
Not only are there only two options, there is a high entry fee to each option, and you can only choose one at a time even if you wanted to pay this entry fee twice. What percent of consumers are willing to carry two phones in their pockets?

So you can compare this to if you could only buy things at two different stores, each store has a hefty membership fee, and you were effectively locked into your decision for at least a year at a time.

szhu··on Uber is destroying thousands of electric bikes and scooters following Jump sale
I see a lot of people commenting on how good the Jump bike design is. I almost missed this excerpt, but it looks like that design might be here to stay:

> Lime's chief executive Wayne Ting has said he prefers the design of Uber's bikes and will deploy more of them in the future.

> However, there were also "tens of thousands" of older-model bikes that Lime did not inherit as part of the deal.

szhu··on macOS Catalina 10.15.5
I typically use video chat apps like Facebook, Google Meet, and Zoom. I think the grid is efficient from a space perspective -- there's less wasted space -- but the grid looks very corporate and boring.

I think there's also a practical advantage of placing tiles haphazardly: it might help spatial memory. It's a lot harder to focus on or find a particular rectangle in a sea of rectangles than it is to follow a shape than looks a little different from the rest. However, I have never used FaceTime group calling (because I don't have most of my friends' phone numbers), so I don't whether this is effective in practice.

szhu··on Push-Button Installer of macOS Guests in VirtualBox for Windows, Linux, macOS
I think this part of macOS has always been consistent.

- shift- anchors the selection as you move the cursor and can be combined with any of the below.

- left/right jumps characters. (backspace/delete deletes characters.) up/down jumps lines.

- opt-left/right jumps words. (opt-backspace/delete deletes words.) opt-up/down jumps paragraphs (unless the app overrides this).

- cmd-left/right/up/down jumps to the edges of the document (unless the app overrides this).

- fn- and ctrl- are not typically used when editing text. In particular, the fn key is specifically used to invoke keys that are only available the extended keyboards, like home, page up, and forward delete. (Extended keyboards don't have the fn key.) I think there was a point where ctrl- did the same thing same thing as opt- or cmd-, probably as a convenience to users coming from other platforms.

Every single modern app has honored this in native text widgets since the first Mac OS X, I believe.

If you remember it being inconsistent, it's possible that you were using apps that use non-Cocoa UI like GTK/Qt/X11 (and possibly Carbon too). It might have been an app from Microsoft or Adobe, who seem to use their own UI toolkits. Or you could have been using a terminal app or developer tool with custom keybindings that didn't conform to these conventions. (VSCode, Atom, and Sublime Text's default keybindings do conform to this, and in Terminal and iTerm, there is a setting you can turn on to make the opt- modifer also conform.)

Which apps do you remember being inconsistent?

szhu··on Out-of-Sync ‘Loners’ May Secretly Protect Orderly Swarms
> painful and unappreciated role

I think the fact that an outcasts are unappreciated is an inherent correlation. Being influenced by appreciation is mostly useful for getting individuals to adhere to the behavior of the group.

As for it being painful? That's all relative. Individuals tend to choose the actions that result in the most reward and least pain, so outcasts probably choose to be outcasts because following the group must produce not as much reward or even more pain.

szhu··on Termux and Android 10
> Most of my time on it these days is supporting others

In general, I actually disagree with even this sentiment, that macOS is worse because it is harder to help others fix certain kinds of problems.

The problem with supporting people on "easier to modify" operating systems is that it creates tech debt. Modify some system files? On the next OS upgrade, they might get overwritten, or, worse, it might cause bugs. Teach a tech beginner that they can google and download an app that solves their problems? The next they they decide to try this on their own, they might unintentionally download a virus, and the OS won't give them a bunch of warnings when they open it.

A system with a loose security policy make it easier for things to work for now, but a tighter security policy makes it potentially easier for the help you provide to cause less pain down the line, even if it means jumping through more hoops right now.

When you help people resolve issues in other operating systems, consider the fact that they might run into just as much hassle, except that it is not visible to you because occurs months or years down the line. (Those issues are potentially more costly, since you might not be free to help at that time.)

No opinion about which system is easier to support in practice with all of this considered, I just wanted to point this out on principle.

szhu··on Electron 9.0
I would love to have framework de-duplication work this way:

- Each app ships with its own copy of the framework at a particular version. This ensures that apps can be installed offline, just as before.

- When running the app for the first time, the OS moves the framework to a centrally-managed location. The new paths are assigned in a way that both preserves both the version names and prevents collisions of frameworks with the same name but that actually have different contents. For example, a version of Electron could be moved to /Library/SharedFrameworks/Electron/9.0.0-1234abc. This change alone makes it such that two apps using identical versions of a framework can share resources.

- Each time the app runs, it tells the OS which version of the framework it's using. For apps that don't want to do anything fancy, this will simply be the version of the framework it shipped with, and the OS should take this to be the default for legacy apps. The key here is to be conservative -- the default setting should absolutely not cause more points of failure than if we didn't have this system.

- But if apps want to do more deduplication and take advantage of extra features of newer versions of the framework that other apps might have installed on the system, they can do that.

- Note: I think it's preferable to have an API that allows the app to request other versions of the framework, rather having the app specify a static dependency range. You don't know how apps might go about checking whether a newer version of a framework is safe to use. For example, maybe the developer wants the app to potentially check the newer framework version's hash against an online whitelist. This flexible solution allows for that.

- The OS keeps track of the frameworks that the app last used. Once no app has last used a version of a framework, that version can be discarded.

- Caveat: If an app allows the user to switch between multiple versions of a framework for some reason (e.g., LaTEX), it will tell the OS that it is using all of those versions. This will ensure that the version that isn't currently being used doesn't get discarded by the OS.

- Bonus points: Apps can also use an OS-provided API to install new versions of a framework. But the API doesn't allow for explicit removal, since other apps might be using it. This also allows apps that always want to use the latest version of a framework to ship with a much smaller app bundle, and download the framework on first launch. (Chrome could probably benefit from this!)

I wanted to write this out to (1) put together learnings I've gleaned from every previous time I've seen this problem brought up and (2) to point out how complex of a solution it would take to get this right. I think this would be way out of the scope of any framework and would be much better suited to be handled at the OS-level. This "framework-managing framework" could also potentially be a third-party library, but its functionality would probably trip up macOS's app checksumming, since frameworks would be removed from the app bundle.

szhu··on ChromeGalvanizer – Harden your browser against extension backdoors and exploits
I tested the following on Mac:

1. Block "(star)" from accessing "(star)://mail.google.com"

2. Install the config

3. Go to chrome://policy/ and click "Reload policies"

4. Open Gmail. Dark Reader doesn't work anymore.

szhu··on The Great CoffeeScript to Typescript Migration of 2017
I don't think the CoffeeScript advocates did anything wrong at all. CoffeeScript was a popular solution with a healthy ecosystem, no one knew when JS was going to get these features, and TypeScript was still an emerging player (just like other typed JS variants like Flow).

Also, when I wrote in CoffeeScript, (1) I loved the JavaScript ecosystem more, (2) I understood the code I wrote better and built and learned more quickly, and (3) I understood the nuances of an JS-extension language, which helped me quickly understand what TypeScript was when I heard of it. I'd assume that other developers got some of these benefits as well, and these benefits may have been well worth the cost of converting from CoffeeScript later.

szhu··on React Native for Windows and Mac
I think the killer feature here is natively targeting Windows AND macOS simultaneously.

The only cross-platform alternatives that I've seen in the ecosystem use either web or Gtk in the frontend, and both of these have a distinctly non-native feel to them.

szhu··on Notion encourages busy-work
For those looking for a Notion alternative: at my previous company, the excessive customizability of Notion convinced me to switch everyone from Notion to a more lightweight and opinionated tool called Slab. We made the switch in early 2019, and far as I know, everyone still loves using it!

This also replaced some other documentation tools we were using, like Google Docs (partially), GitHub repos of Markdown docs, and Guru.

https://slab.com/

(I'm not affiliated with Slab other than as stated above.)

szhu··on Apple engineer in need of OSS maintainers
A good example is ridiculousfish, the maintainer of Fish shell:

https://github.com/ridiculousfish

https://ridiculousfish.com/blog/about.html

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

szhu··on Chrome Has a Document Design Mode
Yes, we heard you the first time. The code snippet kn0where posted has the same effect. :)

I looked into this some more, and I think the actual difference between `document.documentElement.contentEditable` and `document.designMode` is subtle and probably mostly just in principle: since contentEditable is set on elements, someone with only access DOM access could potentially toggle it. But someone with only DOM access cannot turn `document.designMode` off.

szhu··on Apple changes default MacBook charging behavior to improve battery health
Tesla sells two versions of that car, one with longer range, even though they have identical hardware. During the hurricane, they lifted the software cap on the shorter-range version.
szhu··on Pointless
Saw |> in the example and came here to say the same thing! I used LiveScript for a while and it was very fun to use for personal projects.
szhu··on The Unfriendly Robot: Automatically flagging unwelcoming comments
I had the same thought, but I think this except from the post assuaged some of those concerns:

"We want to make clear here that even though the current version of the robot appears to be performing amazingly well, our human flaggers are just as important as ever. The only reason the robot is able to do as well as it’s doing is because of the 100,000+ flags that humans have raised and moderators have handled. The robot is a way to find things that look like things humans have flagged before, but we don’t think it can identify truly novel modes of unfriendliness. Only the humans in our system can do that. So if you see unfriendliness in the comments, please flag it. You’re helping to make Stack Overflow better."

szhu··on Securing WebViews with Chrome custom tabs
> While not all users have Chrome installed, the vast majority do. For those who do not, we are using the browser fallback method described above (option 3); other than adding one line of code, we get the fallback for free from CCT. As noted before, the browser fallback is not the ideal user experience due to its latency, but it does maintain the high level of security that Plaid requires.
szhu··on Tell HN: Zoom runs application from Time Machine backup when uninstalled on Mac
I checked before, and if I recall correctly, Time Machine backups are protected at the kernel level -- you cannot modify them, even with sudo. You can delete the whole backup, but you cannot modify part of it.

> but executing things from the backup directory is another.

Time Machine backups are structured in a very non-proprietary way. Each backup is just a folder, protected from modifications, with hard links used to save space. If anything, I'd say good on Apple for supporting a backup format that works exactly like making a copy of a folder.

szhu··on How the Zoom macOS installer does its job without you clicking ‘install’
Homebrew Cask's uninstall scripts are basically a community-maintained "best guess" at to how to full uninstall each piece of software. It's generally pretty reliable, and I do use it to remove non-brew installs sometimes.

Note: I have contributed casks to Homebrew Cask before.

szhu··on Show HN: Excel-like table editing for Markdown
Possibly relevant for those looking for easier ways to create Markdown tables: A few years ago, I wrote a spec for Markdown tables using a subset of YAML -- no GUI required for authoring.

Curious what HN thinks of it: https://github.com/IFTTT/tablerize

szhu··on Visa, Plaid, networks, and jobs
I had no idea how recently modern credit cards were invented until reading that first paragraph. Wild.

https://en.m.wikipedia.org/wiki/Visa_Inc.

szhu··on Ask HN: Best solutions for keeping a personal log?
This might get buried, but have you considered using your calendar? I create calendar events in the past to keep track of where I've spent my time. If you want to create an event quickly, there are tons of integrations. You can even use Siri or the Google search box.

I don't do thi s, but if you want to attach things to your entries in retrospect, most calendar providers have APIs that let you edit the calendar description. In any case, the ICAL format is easy to parse yourself. And each event has an ID, if you want to keep the augmented data elsewhere.

szhu··on Ask HN: What do you Google every single time and never just memorize?
I use fish shell, which lets you create abbreviations. Abbreviations are like shell aliases, except that after you type them, they expand to the entire command -- so it helps you memorize the real thing as well! Also there's auto-complete, which helps you find your saved abbreviations.

For example, to save an abbreviation:

$ abbr undo-unpushed-commit 'git reset --hard HEAD^'

... later ...

Start typing a few chars and it'll suggest the rest:

$ undo-u|npushed-commit

Press the right arrow key to accept the suggestion

$ undo-unpushed-commit|

When you press enter or space, the abbreviation will expand:

$ git reset --hard HEAD^ |

---

There are a lot of other reasons to use fish shell. For example, when you save abbreviations or functions or aliases, they immediately persist and propagate to other shell windows!

https://fishshell.com/

szhu··on Customizing the Cocoa Text System
Another great article about customizing key bindings: https://macromates.com/blog/2006/multi-stroke-key-bindings/

This one talks about using it to insert commonly used special characters.

(My own keybindings, based on this: https://github.com/szhu/important-things/blob/39f45bb/keybin...)

szhu··on My disabled son's amazing gaming life in the World of Warcraft
Amazing article.

btw, can the title be changed? The real title says "disabled" but the one here says "readonly" -- I can only imagine what kind of automatic substitution caused this.

szhu··on Facebook says a bug caused its iPhone app’s inadvertent camera access
It's the rear camera that's activated...

https://twitter.com/neo_qa/status/1190639141979140097

← PreviousPage 4 of 5Next →