What did I learn from the workshop Basic React Hooks by Kent C. Dodds? Previously, I wrote down my learnings from the React Fundamentals workshop. The second workshop introduces React hooks. Here are some insights that I found useful: Set Initial State Via Props Set an initial value by adding props to a component: <Greeting initialName="George"> Take that as an argument to the function and pass it down to useState:
Kent C. Dodds released his Epic React training course with a big fanfare last week. I was on the fence of buying this, as the pro license is a premium training course that comes with a premium price tag. The course is expensive compared to other online courses. For example, a year-long-subscription to Frontend Masters costs roughly the same. But as a life-long learner, I’m dedicated to becoming a better programmer.
I have an Acer Nitro 5 notebook with two fans that I can’t control directly. But sometimes I want to manually control the fan speed: set them up to 100% for a short time, or slow them down to avoid noise. On Arch Linux (or Manjaro Linux) there are some tools that can help with that. (For more information, refer to the Arch Linux wiki.) One of options for fan speed control is nbfc, a cross-platform service for notebooks.
Self-deployed FaaS with Docker Swarm Serverless is all the rage right now. Instead of maintaining a server and its infrastructure, you can create self-contained functions that do the job. This can be a boon for front-end developers. A bespoke front-end client written in React.js or another framework can easily be enhanced with back-end code. It’s now trivial to add a secure integration with a payment provider like Stripe.
Here are the links for this week: How to Build a Jamstack Site with Next.js and Vercel - Jamstack Handbook: a quick guide to a Next.js workflow 11ty Recipes: a list of short instructions on how to build an Eleventy side from scratch Create a JSON feed with 11ty: another recipe for the static site generator Eleventy Ruby On Rails Crash Course 2020: full 2-hour video crash course on Ruby on Rails (web framework) Noodel.
Today I tried to create a docker secret for a Docker Swarm stack. Why? The secret is encrypted and you cannot read it. I’ve used environment variables before, but they are stored as plain text. You can see them if you inspect the Docker service/image. It took me a while to figure out how to use docker secrets with a docker-compose.yml. You can use Docker secrets both locally (docker-compose up) and for production (docker stack deploy).