Friday Picks 072

Read more →

4 TILS from the Epic React Basic React Hooks Workshop

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:
Read more →

Friday Picks 071

Read more →

3 TILs from the Epic React Fundamentals Workshop

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.
Read more →

Fan Speed Control on Manjaro Linux With Nbfc

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.
Read more →

Friday Picks 070

Read more →

Functions as a Service With SSL Using OpenFaaS, Docker Swarm, Traefik 2 and a Socket Proxy

Functions as a Service With SSL Using OpenFaaS, Docker Swarm, Traefik 2 and a Socket Proxy
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.
Read more →

Friday Picks 069

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.
Read more →

Using Docker Secrets With Docker Compose

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).
Read more →

Heroku React Express Content Security Policy With Stripe, Cloudinary and Google Fonts

How to fix “Refused to connect to xxx because it violates the following Content Security Policy directive” on Heroku I’ve deployed a MERN stack app to Heroku: Mongo DB, Express.js, React.js, Node.js. The app uses Google Fonts and Stripe Checkout. I’ve built the React app via Create React App. My last deploy went wonkers. The app didn’t load any JavaScript because of Content-Security-Policy failures. In this post I’ll show you how to fix those errors and how to successfully re-deploy your MERN app to Heroku.
Read more →