A Telegram Spam Blocker Bot Based On Bayesian Algorithm

中文版本 1 Preface I spent a weekend building a Telegram spam blocker bot based on Bayesian Algorithm @BayesSpamSniperBot (https://t.me/BayesSpamSniperBot). The project is open-sourced at: https://github.com/ramsayleung/bayes_spam_sniper 1.1 Telegram Telegram is a popular instant messaging application, similar to Snapchat and WhatsApp, with over 1 billion users. It supports many powerful features like cloud chat history storage, clients for Linux, Mac, Windows, Android, IOS, and Web (all open-source), Channel, and arguably the most powerful bot system I’ve ever seen. ...

August 30, 2025 · 8 min · 3948 words

Reflections on Ten Years of Programming

中文版本 1 Preface Malcolm Gladwell’s “10,000-hour rule” suggests that continuous investment of 10,000 hours of effort is sufficient to reach expert level in any field. Based on 20 hours of practice per week, this requires about 3 hours of daily investment, taking roughly ten years to achieve this goal. Since I wrote my first line of C code, more than ten years have passed. During this period, I have written over 300,000 lines of code, some of which, written at WeChat, have served more than 1 billion users. ...

December 15, 2024 · 5 min · 2270 words

TIL: Git Blame with Following

Developers usually use git blame in GUI tools like GitHub Blame or using GitLens blame in VSCode: Even though GUI tools is intuitive, but the Git CLI has much more powerful tooling for finding something closer to the real story behind your code. There are many scenarios that CLI is valuable, the first is ignoring the whitespace changes. For example, if you formatted your C++ codebase with clang-format or Javascript codebase with prettier, you haven’t actually changed the codebase, but you’re the owner of tons of lines of code. ...

April 13, 2024 · 3 min · 431 words

TIL: Git Conditional Configs

Every Git user will have probably been asked to set up their Git at the first time: 1 2 git config --global user.name "Ramsay Leung" git config --global user.email ramsayleung@gmail.com The above command will simply add the user.name and user.email value into your ~/.gitconfig file 1 2 3 4 5 6 7 8 > cat ~/.gitconfig [user] name = Ramsay Leung email = ramsayleung@gmail.com [core] quotepath = false [init] defaultBranch = master You could also specify --local argument to writes the config values to .git/config in whatever project you’re currently in. ...

April 7, 2024 · 2 min · 326 words

Rewind your Github summary

1 Goodbye 2023 As I farewelled to 2023, a year marked by numerous changes and personal evolution, I find myself recollecting the multitude of experiences that unfolded. My 2023 journey was nothing short of fascinating and exciting, prompting me to revisit the year from various angles. After seeing hoards of posts in social media generated by Github Contributions Chart, I thought I could also build an APP to summarize my Github contribution for every year for friends to have fun. ...

January 1, 2024 · 2 min · 241 words