Feng's Notes Isn't coding fun?

React Infinite Scrolling

Infinite scrolling is a feature that allows you to load content continuously when users scroll down the page. It is widely used in social media apps such as Facebook, Twitter, Instagram, etc. I happened to implement this feature with react recently and I would like to share my experience and thoughts on this topic.

Wails Review

I was looking for an all-in-one solution for building apps with golang. Then I found Wails, it is claimed as a cross-platform framework for building apps with Go as backend. On the frontendside, it allows you to use modern web technologies such as Vue.js, React.js, and Angular.js. It sounds fancinating, so I decided to give it a try and dig a little bit on how it works.

CodeDeepDive -- Loki (1)

This is the start a series of posts about the notes I made when I read the source code of popular open source projects. I myself learned a lot from digging into the code of open source projects. I hope it can help you too. I will start with Loki, a log aggregation system inspired by Prometheus. Overview grafana/loki consists two components: Loki: the log aggregation system Promtail: the agent to collect logs and send to Loki in a nutshell, loki and promtail is a service-client arhitecture.

How to monitor springboot metrics with prometheus and grafana

When you deploy springboot apps to production, you would like to know how your apps are doing. You would like to know how many requests are coming in, how much memory is used, how many errors are there, etc. In this article I would like to share my experience on how to monitor your springboot app with prometheus and grafana. Structure Assuming you already know what is prometheus and grafana. If not, you can check out their official websites.

How to build a modern web app with Go and React

Go is a fancinating language for building backend service, while React is a modern framework for building frontend web app. I would like to share my experience on how you can put this two together to build a full stack web app. The structure The chance is you probably can find a template on github and develop your app based on that. But I recommend you pause for a second and think about the structure of the codebase.

Learn How to Build Go Applications From Grafana

Grafana has developed really fast in the past few years. It has been the de facto standard for observability. I have been using grafana and loki for a while and I am really impressed by its performance and the quality of the code. Grafana builds most its backend components in Go. Meanwhile I am also using Go to build stuff. So it seems a good idea to learn some good practice from Grafana’s codebase.

Build Go Commandline App With Cobra

The framework I am using to build this blog is Hugo. Under the hood, it uses Cobra to build the command line interface. Besides Hugo, Cobra is also used by many other popular projects such as kubectl, github cli, etc. I was curious about how it works so I decided to learn by building a simple command line app with it. The app I am going to build is a regex tool that uses openAI’s API to generate a regex expression based on a list of strings or the semantic meaning of the given strings(e.

Goroutine Pool review

Goroutine is perhaps the main reason why people choose golang for their projects. It is a lightweight thread managed by the go runtime. It is also easy to use. You can simply use go keyword to start a goroutine. However, if you need to run a large number or cpu intensive goroutines, you might want to use a goroutine pool to manage them and make sure you don’t run out of memory or cpu resources.

Task queues in different languages

Task queue is used widely in software development. It is a mechanism to distribute work across threads or machines. It is also a way to coordinate workers to perform tasks. The scenario could be a web application that needs to process a large number of requests, a data pipeline that needs to process a large amount of data or a scheduled job that needs to run periodically. I have used task queues in different languages.

Rss reader in golang -- Miniflux review

Background I have been using feedly for years to read rss feeds. It is a great service however it grows more and more complicated and tries hard to sell me their premium features. I understand that they need to make money, but I decided to find a self-host solution for my simplest need: read self selected rss feeds on a clean UI. no AI recommendation, no social sharing, no fancy features.