On “Secure Contexts” in Firefox, HTTPS for local development, and a potential nice gesture by Chrome

👋 This post also got published on Medium. If you like it, please give it some love a clap over there. Earlier today, in a post entitled Secure Contexts Everywhere, it was announced on the Mozilla Security Blog that Firefox from now on will only expose new features such as new CSS properties to secure …

JavaScript: Remove a property from an object immutably by destructuring it

Say you have a JavaScript object like this: const user = { firstName: ‘Bramus’, lastName: ‘Van Damme’, twitter: ‘bramus’, city: ‘Vinkt’, email: ‘[email protected]’, }; And now say you want to create a copy of the whole object, containing all properties except for the email property. # The oldskool way: The first idea that came to …

Automatically set up your Mac and configure macOS using ./freshinstall

Recently I configured my new MacBook Pro. I decided to start with a clean slate and not migrate anything from my old MacBook. To configure macOS I whipped up ./freshinstall, which automates that process. Steps included are: Configure macOS Preferences and the like Generate and load SSH keys Install the essentials: XCode, Git, Homebrew Copy …

Stealing Usernames, Passwords, and other (Personal) Data via Browsers and NPM Packages

👋 This post also got published on Medium. If you like it, please give it some love a clap over there. Late 2016, Stoyan Stefanov published “Oversharing with the browser’s autofill”. It’s an article on stealing personal data using the browsers their form autofill feature. The attack works by leveraging abusing the fact that autocompletion …

On release cycles and deprecating stuff

From “What Really Happened with Vista: An Insider’s Retrospective” by Ben Fathi: The three year release cycle meant we rarely knew what the competitive landscape and external ecosystem would look like when we started a release […] What we thought we knew three or four years ago when we planned a given OS release was …

Launch a React Native app with “Debug JS Remotely” enabled by default

I had a bug in a React Native app which only occurred on the very first launch of the app, right after install. The bug was situated in a complex Redux Saga which bootstraps the application and populates the Redux store with things like an (anonymous) API token, (remote) config settings, etc. The bug didn’t …

Cancel a JavaScript Promise with AbortController

In How to Cancel Your Promise Seva Zaikov has done a nice writeup exploring several attempts on how to cancel promises. After also touching generators and async/await the conclusion is that you can’t actually cancel a promise with the techniques mentioned (you may introduce some workarounds to track the cancelled state yourself, yet that won’t …

JavaScript’s setTimeout “other” arguments

When using setTimeout, it’s not needed to wrap a function with arguments into an anonymous function and call it from there. What you can do instead is pass the function in via its name (as you would do with a function that has no arguments), and pass in the arguments via the 3rd, 4th, 5th, …

Login with root and no password on any mac running macOS High Sierra

This tweet is currently making rounds on Twitter: You can access it via System Preferences>Users & Groups>Click the lock to make changes. Then use "root" with no password. And try it for several times. Result is unbelievable! — Lemi Orhan Ergin (@lemiorhan) November 28, 2017 And yes, that actually works: enter root as a username, …

ESNext: Dynamically import ES modules with “dynamic import()

UPDATE June 2019: This feature has now advanced to Stage-4 and will be part of the ES2020 Specification! 🎉 One of the recent ECMAScript proposals that landed in Chrome 63 is dynamic import(): Dynamic import() introduces a new function-like form of import, which allows one to import on demand. It returns a promise for the …