Skip to content

Instantly share code, notes, and snippets.

View kariem2k's full-sized avatar

Karim Ahmed kariem2k

View GitHub Profile
@chenhunghan
chenhunghan / gist.md
Last active March 14, 2026 06:09
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.

@ErikAugust
ErikAugust / spectre.c
Last active October 7, 2025 15:37
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@bkaradzic
bkaradzic / orthodoxc++.md
Last active February 25, 2026 12:28
Orthodox C++

Orthodox C++

This article has been updated and is available here.

@kennytm
kennytm / test.cpp
Created November 30, 2012 20:49
Substituting template arguments in the clang C++ library
#include <type_traits>
#include <cstdio>
namespace L {
template <int n>
struct N {
static constexpr bool equals(int m) { return m == n; }
};
@rmartinho
rmartinho / hate.markdown
Last active July 15, 2020 01:33
I will hate you

Dear C++ library writer,

  1. If your library forces me to use new all over, I will hate you.

  2. If your library has types with bogus values, I will hate you.

  3. If the documentation for your library gets the terminology of its own domain wrong, I will hate you.

  4. If I say "My God, it's full of stars!" when I see the function signatures in your library, I will hate you.