Blogs

Getting the MacBook Air M4

I recently picked up a MacBook Air M4. After a few days of use, I’m quite happy with it, so here are some quick notes on my experience.

Mar 19, 2025

Once Handling in EventEmitter

EventEmitter Initial Version class EventEmitter{ constructor(){ this.events={} } on(type,listener){ if(!this.events[type]){ this.events[type]=[] } this.events[type].push(listener) } emit(type,...args){ this.events[type].forEach(listener=>{ listener.call(this,...args) }) } off(type,listener){ if(this.events[type]){ const index=this.events[type].indexOf(listener) if(index!==-1){ this.events[type].splice(index,1) } } } once(type,listener){ const onceListener=(...args)=>{ listener.call(this,...args) this.off(type,onceListener) } this.on(type,onceListener) } } Testing const eventEmitter=new EventEmitter() const listener=(args)=>{ console.log(args); } eventEmitter.once('test',listener) eventEmitter.off('test',listener) eventEmitter.emit('test',{a:1}) When executing the above code, you’ll find that the test event was triggered once, but it should not execute because it was turned off. The solution is as follows.

Mar 18, 2025

Loading node_modules Resources in VSC WebView

A guide on properly loading and configuring node_modules resources in VSCode WebView extensions, including setup and best practices.

Mar 17, 2025

VSCode Extension Internationalization Support

A comprehensive guide on implementing internationalization in VSCode extensions, covering both menu and extension content localization.

Mar 14, 2025

The Host Field in HTTP Request Headers

Recently came across a frontend question: “Is the Host field necessary when sending HTTP request headers?” I hadn’t paid much attention to this before, so I did some research and here’s a summary.

Mar 13, 2025

Using Screen Studio for Screen Recording

A comprehensive review of Screen Studio, a powerful screen recording tool for macOS and Windows, highlighting its key features, advantages, and limitations.

Mar 12, 2025

node-sass Discontinued Maintenance

Recently while looking at dependency package upgrades for an old project, I noticed that node-sass has been discontinued from maintenance, so I’m documenting this specifically. Main Reasons 1. Insufficient Maintenance Manpower The recent maintenance team no longer has enough bandwidth (energy and time) to continue updating the project node-sass hasn’t had a new release version for a year and a half 2. Technical Evolution Process node-sass was the first official Sass compiler available in the JavaScript ecosystem It’s essentially a Node.js wrapper for LibSass Now the official recommendation is to use Dart Sass as the primary implementation 3. Current Status The npm package has been marked as deprecated The GitHub repository has been archived to avoid confusion with active Sass repositories The underlying LibSass implementation: Although deprecated, it hasn’t completely reached end-of-life Maintainer Marcel Greter still occasionally makes fixes There’s no officially supported way to use this implementation from Node.js Migration Recommendation If you’re currently still using node-sass, the official strongly recommends migrating to the primary implementation Dart Sass.

Mar 10, 2025

Cloudflare Security Check

Recently, a friend in our group chat encountered an error while filling out a waitlist form on manus and thought it was a site issue. After investigating, I found it was actually a Cloudflare issue. Once the problem was identified, it was easy to solve. I used my proxy node to help fill out the form. This small issue highlights how many people are unaware of Cloudflare’s security checks, so I’ll briefly summarize it here.

Mar 10, 2025

Using Firecrawl MCP in Cursor

A comprehensive guide on integrating and using Firecrawl MCP within Cursor IDE, covering its features, configuration, and practical usage examples.

Mar 9, 2025

Screen Time in Apple Systems

Today a friend asked me what the gray bar chart in Apple’s Screen Time statistics means. I actually wasn’t too sure either, so I looked it up and here I’ll record what I found.

Mar 7, 2025