Skip to content

Instantly share code, notes, and snippets.

@chenhunghan
chenhunghan / gist.md
Last active March 14, 2026 09:49
One Prompt to Save 90% Context for Any MCP Server

Local Code Mode for MCP

Most MCP servers just wrap CRUD JSON APIs into tools — I did it too with scim-mcp and garmin-mcp-app. It works, until you realize a tool call dumps 50KB+ into context.

MCP isn't dead — but we need to design MCP tools with the context window in mind.

@pengx17
pengx17 / export.js
Last active January 23, 2026 04:40
Export app.affine.pro and import into AFFiNE client
(async () => {
async function blobToBase64(blob) {
return await new Promise((resolve) => {
const reader = new FileReader();
reader.onload = function() {
resolve(reader.result.split(',')[1]);
}
reader.readAsDataURL(blob);
});
}
@Kautenja
Kautenja / tar-progress.md
Last active December 29, 2025 14:51
one-liners for using tar with gzip and pv for a progress bar

Compress

tar cf - <files> -P | pv -s $(du -sb <files> | awk '{print $1}') | gzip > <some .tar.gz file>

where:

  • `` is the root-mounted (i.e. starts with /) path to the files