Learning Go: Second Exercise

Today's exercise is all about slices. We'll need to generate an image by passing a slice of slices to pic.Show. Here's the link: https://tour.golang.org/moretypes/18 package main import "golang.org/x/tour/pic" func Pic(dx, dy int) [][]uint8 { slice := make([][]uint8, dy) for fIndex…

Read this article

Learning Go: First Exercise

I decided to blog my self study adventures in learning Go. I'll start with A Tour of Go's exercises and then follow through my own personal small project, probably a blogging platform that reads markdown files. I already did this, and have my go-learn self study codes in github, but…

Read this article

Featured

Looping in successive order with Async calls

Let's first define an example problem to better understand the issue we have with normal looping: For example, we have an array of post IDs that we would fetch and then print it out on the console const ids = [1, 2, 3, 4]; for (var id of ids) { fetch(`${API_…

Read this article

Easily turn your app to Progressive Web Apps through webpack plugins

If ever we wanted our WebApp available even if the user does not have any internet connection, we would need to use service workers. But the thing with service workers is that they're not "easy" to implement. It's a good thing though that the GoogleChrome team released a node module…

Read this article

Featured

Why I switched to Visual Studio Code

I used to be a Sublime Text user, and used to always go back to Sublime after trying out other editors. I actually bought a license for $70 even though I could do away without it. I bought it to encourage the developers to keep on improving Sublime. But Sublime's…

Read this article

Responsive web designs through EQCSS

EQCSS allows us to style elements based on the element's state. It is similar to CSS' media queries, but with the added feature to style elements based on the element's dimension and contents, and not just based on the browser's width and height. This got me interested since my previous…

Read this article

Using JSON parse and stringify to clone objects

Immutability is important. The stackoverflow article that I just linked would explain why immutability is important. I am accustomed to using Immutable.js at work, but when I came across an ancient project that didn't make sense to add a new library just for using immutable objects, I had to…

Read this article

Featured

Using datasets to avoid inline arrow functions

Adding an inline anonymous/arrow function in React is not recommended due to the nature of how react behaves. The render method would always be called each time a state or property is updated, which would then create a new function if we are using inline arrow functions, and then…

Read this article