React: When to use useMemo and useCallback

Insightful post by Kent C. Dodds on the costs and benefits of React’s useMemo and useCallback. We hear a lot that you should use React.useCallback to improve performance and that “inline functions can be problematic for performance,” so how could it ever be better to not useCallback? Just take a step back from React and …

PHP Insights – Analyze the Code Quality of your PHP Projects

PHP Insights is a Static Analysis Tool for your PHP code. It contains built-in checks for making code reliable, loosely coupled, simple, and clean. Works out-of-the-box with the current set of popular frameworks. # First, install: composer require nunomaduro/phpinsights –dev # Then, use it: ./vendor/bin/phpinsights PHP Insights →

The North Face – Top of Images

When you first start planning a big trip, step one will likely happen at the Google search bar. Step two might be clicking onto the images of your target destination. The North Face, in a campaign with agency Leo Burnett Tailor Made, took advantage of this consumer behavior to keep its name top of mind …

Unraveling the JPEG

“Unraveling the JPEG” is a great deep dive into the JPEG image format. This article is about how to decode a JPEG image. In other words, it’s about what it takes to convert the compressed data stored on your computer to the image that appears on the screen. It’s worth learning about not just because …

SwiftUI

Yesterday, apart from revealing a $999 monitor stand, Apple announced SwiftUI which got me quite excited. SwiftUI is an innovative, exceptionally simple way to build user interfaces across all Apple platforms with the power of Swift. Build user interfaces for any Apple device using just one set of tools and APIs. With a declarative Swift …

The Economics of Open Source // Introducing Entropic, a federated package registry

At JSConf EU 2019, CJ Silverio – former CTO at NPM Inc – gave this talk on why a VC-funded private package registry (read: the one ran by NPM Inc) holds many dangers. The JS package commons is in the hands of a for-profit entity. We trust NPM Inc with our shared code, but we …

Including content from other files in your HTML (“HTML Includes”)

Nice find by Scott Jehl from Filament Group: Instead of fetching files over XHR and then injecting their contents, you can also use an iframe + leverage its onload event to include the contents of any other file directly into the current web page. <iframe src="signal.svg" onload="this.before((this.contentDocument.body || this.contentDocument).children[0]);this.remove()" ></iframe> The example above loads up …