Learning Go: Fourth Exercise

The fourth exercise is all about function closures. We're tasked to create a Fibonacci function using function closures. Here's the link: https://tour.golang.org/moretypes/26 package main import "fmt" // fibonacci is a function that returns // a function that returns an int. func fibonacci() func() int { cur, next := 1,…

Read this article

Learning Go: Third Exercise

The third exercise is all about maps. We'll need to count the number of times a word has occurred in a sentence. Here's the link: https://tour.golang.org/moretypes/23 package main import ( "golang.org/x/tour/wc" "strings" ) func WordCount(s string) map[string]int { words := strings.Fields(…

Read this article

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

My notes in setting up Arch

I'm aware that there are many many articles on how to setup Arch Linux, with the official Wiki as the best one to check out first. I just documented my experience on setting up Arch with the objective that I should be able replicate the same setup and environment on…

Read this article

Featured

When distro hopping...

So I've been distro hopping for the past couple of weeks, and I always googled how to format my boot drive and then write an ISO to my flash drive as bootable (boot-able, I'm getting a wrong spelling indicator with the "bootable" word XD) USB drive. Since I did that…

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