I’ve been sick the last few days and wasn’t able to program or to write blog posts. For now, I will cut back on blogging. I’m not sure if the daily format is the best for me. The quality of the blog posts is often subpar. Daily blogging was a good exercise for me. It forced me to produce. I published my thoughts and learnings instead of being afraid that my writing is not good enough.
Let’s say I have some static files I want to serve. For example, a React app or a Svelte app. Create Svelte App Let’s use the Svelte template: npx degit sveltejs/template svelte-app cd svelte-app npm install Now we need to create a production build: npm run build The command will create an optimized build in the public folder. Create Deno Server Install Deno. We’ll use the third-party module Abc to create a simple web server.
Today I learned about Array.prototype.fill and friends. You can use the method to fill an array with values, or create a new array filled with values. Pitfall: if you fill a new array with a value that is an object, each slot in the array will reference that object. const newArr = Array(4).fill() > [, , , ] newArr.push(8) > 1 newArr > [, , , ] Further Reading MDN: Array.
I’ve learned lots of useful concepts and techniques from courses on Udemy. Most of my programming education stems from free resources like Udemy, Coursera, or edx. Udemy courses are very cheap. The platform often runs sales around USD $10. The course quality differs. You will get everything from crappy material to incredible lessons that will teach you invaluable skills. I’ve completed dozens of courses. Tutorial hell is real. Remember to put in the work and practice a lot.
Postman or Insomnia are popular GUI tools to explore and create HTTP requests for working with APIs. But did you know that you can use a simpler and still powerful alternative on the terminal? Of course, I’m talking about curl! Or in my case, rather curlie, the “interface of HTTPie with the features of curl". To be fair, Postman and Insomnia offer more features like automated testing, workspaces, designing & mocking interfaces, etc.