How to Perform Calendar Calculations in Your Head

In case you want to impress your family over Christmas’/New Year’s Dinner: A so-called calendrical savant (or calendar savant) is someone who despite their intellectual disability (typically autism) can name the day of the week of a given date, or visa versa in a few seconds or even a tenth of a second (Kennedy & …

Getting Closure on React Hooks

Ace talk by Shawn Wang: The design of React Hooks requires a good understanding of closures in JavaScript. In this talk, we’ll reintroduce closures by building a tiny clone of React! This will serve two purposes – to demonstrate the effective use of closures, and to show how you can build a Hooks clone in …

Running the same Node.js code on Google Cloud Functions, App Engine, and Cloud Run

Google Cloud has a number of options to run your code. We can deploy a function to Cloud Functions, an app to App Engine, or an app with a custom runtime (a Docker container) to Cloud Run. In this post the same code snippet is deployed to all three Google Cloud Platform features. Locally the …

Subtract

Derek Sivers, on how to improve life, not by adding things but by subtracting things: The least successful people I know run in conflicting directions, are drawn to distractions, say yes to almost everything, and are chained to emotional obstacles. The most successful people I know have a narrow focus, protect themselves against time-wasters, say …

react-native-v8 – Opt-in V8 runtime for React Native Android

The aim of this project is to support V8 runtime for React Native. Designed as opt-in package, it should easy to integrate with existing React Native projects. After installing it, you’ll need to adjust your build.gradle files so that it includes the new runtime — a/android/app/build.gradle +++ b/android/app/build.gradle @@ -161,11 +161,18 @@ android { } …

How to Implement Redux in 24 Lines of JavaScript

90% convention, 10% library In this post Yazeed Bzadough walks you through creating your own Redux implementation. // simplified createStore function const createStore = (yourReducer) => { let listeners = []; let currentState = yourReducer(undefined, {}); return { getState: () => currentState, dispatch: (action) => { currentState = yourReducer(currentState, action); listeners.forEach((listener) => { listener(); }); …

React Hook Form – Form Validation Hook based on Uncontrolled Components

Now this is an interesting approach, building further upon Uncontrolled Components: The React Hook Form (react-hook-form) library provides a new form validation mechanism which embraces uncontrolled form validation and support controlled components. The core idea is to register HTML input’s ref into the custom hook and therefore subscribe to its input value, validate and evaluate …

Made with WebAssembly

After several Twitter threads on highlighting use cases, projects, and companies in production using WebAssembly, myself and a few other Wasm communitty members thought it’d be a great idea to have a dedicated place to find projects using WebAssembly, and highlight what WebAssembly can be used for! Some interesting stuff to find in there, like …