Hi there 馃憢

There is Ramsay’ personal blog, where he writes about life, software enginering, distributed system and thought.
Ramsay Leung

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鈥檛 actually changed the codebase, but you鈥檙e the owner of tons of lines of code....

April 13, 2024 路 2 min 路 425 words 路 Ramsay Leung

TIL: Git Conditional Configs

Every Git user will have probably been asked to set up their Git at the first time: 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 > 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 ....

April 7, 2024 路 2 min 路 307 words 路 Ramsay Leung

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 路 Ramsay Leung

How to share resource between CDK stacks

1 Introduction 1.1 IaC Infrastructure as code(IaC) is the managing and provisioning of infrastructure through code instead of manual processes, for example, clicking button, adding or editing roles in AWS console. 1.2 AWS CloudFormation AWS CloudFormation is the original IaC tool for AWS, released in 2011, which uses template files to automate and mange the setup of AWS resources. 1.3 AWS CDK AWS Cloud Development Kit(CDK) is a product provided by AWS that makes it easier for developers to manage their infrastructure with familiar programming languages like TypeScript, Python, Java, etc....

June 28, 2023 路 4 min 路 683 words 路 Ramsay Leung

Topological Sort

1 Definition In computer science, a topological sort or topological ordering of a directed graph is a linear ordering of its vertices such that for every directed edge uv from vertex u to vertx v, u comes before v in the ordering. It sounds pretty academic, but I am sure you are using topological sort unconsciously every single day. 2 Application Many real world situations can be modeled as a graph with directed edges where some events must occur before others....

May 22, 2022 路 5 min 路 874 words 路 Ramsay Leung