Ligang Yan颜力刚

Writing

27 posts

2026

  1. A Vibe Coding Guide: Mistakes I Made and a Self-Check List for Your AIWhat I learned from 787 commits written with Claude and some forty mistakes along the way. Every item comes with a self-check prompt: paste the whole post into your AI and it can go through your project item by item.
  2. Gradient Descent, Line by Line: Twelve Lines of Python and the Calculus Behind ThemA twelve-line function fits the best straight line through a cloud of points: it starts flat at zero and 900 times over asks which way is less wrong. Taking it apart one line at a time — what a gradient actually is, where the formulas come from, why the minus sign, and what alpha does.
  3. Rebuilding my personal site on Astro and Cloudflare WorkersThe first post on the new site, on why I picked this stack and how the site is meant to grow.
  4. Does Canada really have no estate tax? The real gap between the two countries' death taxesCanada has no estate tax but it has deemed disposition: every unrealised gain is taxed at once on the final return, and an RRSP is included at 100%. The US has step-up in basis and a $15 million exemption. Four household scenarios with the bill worked out, plus a trap few people know about: a Canadian holding more than $60,000 of US stocks has a US estate-tax filing obligation.
  5. Hong Kong participating insurance, taken apart: structure, commissions, sales scripts, and how it compares to just investingThe guaranteed part is about 1%; the illustrated 6 to 7% only approaches after twenty or thirty years, and break-even usually takes 15 to 20. First-year commissions once reached 100% of first-year premium. It does not escape CRS reporting and is not a compliant way to move mainland renminbi offshore. All of that laid out, then compared with term life and an index fund.
  6. Importing from China to Canada, end to end: 22 steps, 9 parties, one cost checklistUsing my first small shipment of EV charging accessories from a factory in Guangdong to my home in Halifax as the example: Incoterms, what a freight forwarder actually does, CARM registration, HS codes, cUL certification, bills of lading and telex release, customs and taxes, and the trap of clearing under someone else's name.
  7. The Coca-Cola "Dividend Arbitrage" Is an IllusionBuy before the ex-dividend date, sell after, and pocket the dividend for free? The price drops by the dividend amount on the ex-date. The people claiming they made a thousand dollars in a few days made it on the share price — and the post is usually an ad for tokenized stock.
  8. Solar From First Principles: From Car-Roof Panels to Intermittent Compute as Buyer of Last ResortSolar already beats farming per square metre, and cells are already cheap. What actually stops us covering the world is deployment cost and the fact that electricity can't be boxed up and shipped like tomatoes. Breaking the cost down per square metre, then looking at one path out.
  9. CurioSeed V4: stack choices and how a small team works with AIThe key decisions behind CurioSeed V4, laid out with their costs: Supabase or Neon, React SPA or Next.js, client-side fetching or SSR, when to split into a monorepo, and a working method of people plus AI plus rule guardrails. Every choice comes with the pitfalls we hit.
  10. A Claude-centric software architectureFor thirty years, software has meant humans translating changing requirements into fixed code. Once a runtime like Claude Code is strong enough, the more efficient approach is to separate the two: settle deterministic logic into a data layer, a function layer and Skill methodology, and hand the uncertain requirements to the runtime to understand and render in real time. With quant-researcher as a worked example.
  11. How autonomous driving could transform road safetyResearch paper as slides · 9 slidesThree structural advantages autonomous vehicles hold over human drivers: no fatigue, consistent rule-following, and perception beyond human eyes, with the numbers from NHTSA, FMCSA and Waymo's 7.1 million rider-only miles.
  12. Three things every AI agent engineer should know: agent architecture, prompt engineering, and MCPA platform-agnostic guide: the agentic loop and multi-agent orchestration, context passing and error propagation, few-shot and structured output, controlling false positives, and the structure, message format and a minimal server implementation of the Model Context Protocol.
  13. Real-time updates from NestJS to Next.js with Server-Sent EventsA step-by-step tutorial: expose an SSE endpoint from NestJS with an RxJS Subject, consume it in Next.js with a small useSse hook, and push events from any service in your backend. Simpler than WebSockets when the data only flows one way.

2025

  1. Goodbye Photoshop? Ten everyday image edits done with Gemini Nano-Banana promptsForget layers and tool palettes. Ten common image-editing jobs, from cutting out a background to style transfer and outpainting, each with the traditional Photoshop workflow and the single Nano-Banana prompt that replaces it.
  2. Google's official prompting guide for Nano-Banana, annotatedWhat Gemini 2.5 Flash Image (Nano-Banana) can do, the one principle behind good prompts (describe the scene, don't list keywords), and Google's example prompts for photorealistic scenes, stickers, logos, product shots, editing, inpainting, style transfer and multi-image composition.

2024

  1. How to Design a PDF Text-to-Speech Service Like SpeechifyText-to-speech (TTS) services have become a popular tool for making content more accessible, providing convenience for users who prefer listening to their text rather than reading it. One of the most well-known TTS platforms is Speechify, which converts digital text, including PDFs, into high-quality audio. When I embarked on building a PDF text-to-speech service similar to Speechify, I faced several challenges and opportunities. In this article, I’ll take you through the steps of how I system-designed this service, from understanding user needs to choosing the right technology stack and scaling the solution.
  2. How I Passed AWS Certified Developer Associate ExamI recently passed the AWS Certified Developer Associate exam. Here are some tips and resources that helped me prepare for the exam.
  3. What story does Black Myth: Wukong tell?Black Myth: Wukong is a video game developed by Chinese indie developer Game Science. The game is based on the classic Chinese novel Journey to the West and tells the story of Sun Wukong, the Monkey King. In this article, we will explore the story of Black Myth: Wukong and how it relates to the original novel.
  4. How to add bilingual subtitles to a YouTube videoA workflow that actually runs: downloading the original captions, the sentence-boundary problem when machine-translating them, adding soft subtitles with a Chrome extension or burning hard subtitles with ffmpeg, and the trade-offs I made building Suinfy.
  5. How I prepare for the final-round interviewIn North America the last round is usually with the hiring manager: short, unpredictable, and decisive. My method is to write out every likely question and its answer in advance. Here are the questions I prepared, the frameworks I used, and a few real stories.
  6. How to Design Uber Eats: A System Design Mock InterviewThis blog post summarizes a mock interview discussion on designing a system like Uber Eats. It explores the technical considerations involved in building a large-scale food delivery platform.
  7. How to design Amazon Prime Video: A System Design Mock InterviewThis blog post summarizes a mock interview discussion on designing a minimalist version (MVP) of Amazon Prime Video. It explores the core functionalities and considerations for building a large-scale video streaming platform.
  8. How to Design a Shopping Cart Page: A System Design Mock InterviewA shopping cart page is a crucial component of any e-commerce website, allowing users to review and modify their selections before making a purchase. Designing an effective shopping cart page requires careful consideration of both functional and non-functional requirements. This blog post summarizes a mock interview discussion on designing a shopping cart page, exploring the core functionalities and considerations for building a scalable e-commerce platform.
  9. How to Deploy Ollama Server on Amazon EC2 with GPU in 10 MinutesThis guide is ideal for individuals or small teams building their own open source local large language model (LLM) AI capabilities in the cloud, ensuring data privacy, customizability, regulatory compliance, and cost-effective AI solutions.
  10. A React Native client for NodeBB: swapping a Firebase login for an API tokenNodeBB is an open-source Node.js forum whose mobile experience is mediocre. I built a React Native client for it, and the two problems worth writing down are third-party sign-in and automatically exchanging that sign-in for a NodeBB API verifyToken.
  11. Six React ref challenges. How many can you get?When to use a ref and when to use state, why a module-level variable gets shared across components, how to drive a video and a scroll position with refs, and how forwardRef works. Six problems, each with the broken code and the fix.

2023

  1. November 2023: a look at Halifax real estateAfter landing in Halifax I spent a few weekends touring houses. Neighbourhood by neighbourhood (Bedford, Clayton Park, Beechville, West End, Long Lake, Downtown), a dozen listings, the rent-to-price ratio and gross yield worked out, and where I thought prices were heading.