Skip to content

Instantly share code, notes, and snippets.

View Meowu's full-sized avatar
🎯
Focusing

Meowu Meowu

🎯
Focusing
View GitHub Profile
@vasuadari
vasuadari / dsa_cheatsheet.md
Created February 1, 2025 11:08
DSA Cheatsheet

DSA Cheat Sheet for Meta Interview Preparation

Arrays & Strings

  • Two Pointers:
    Use when working with sorted arrays or to solve problems like pair-sum and partitioning (e.g., “left and right pointers meet in the middle”).
  • Sliding Window:
    Ideal for subarray problems—expand or contract the window to meet the required sum or length conditions.
  • Prefix Sums:
    Precompute cumulative sums to answer range queries in O(1) time.
  • In-place Reversal:
@willccbb
willccbb / grpo_demo.py
Last active November 2, 2025 13:27
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
"""
citation:
@misc{brown2025grpodemo,
title={Granular Format Rewards for Eliciting Mathematical Reasoning Capabilities in Small Language Models},
author={Brown, William},
@hellokaton
hellokaton / next.config.ts
Last active April 26, 2025 10:15
解决国内 nextjs 三方登录等网络问题
const isDev = process.env.NODE_ENV === "development";
if (isDev) {
require("./proxy-setup");
}
@Maharshi-Pandya
Maharshi-Pandya / contemplative-llms.txt
Last active October 30, 2025 16:02
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@wong2
wong2 / README.md
Last active January 12, 2025 03:12
How to run Claude computer use demo on macOS

Note

It is necessary to give Terminal (or iTerm or whatever you use) the permission to control the computer. This can be done in System Settings ➔ Privacy & Security ➔ Accessibility.

Guide

  • Install cliclick for mouse & keyboard emulation
    • brew install cliclick
  • Clone Anthropic quickstart repo
    • git clone https://github.com/anthropics/anthropic-quickstarts.git
  • cd computer-use-demo
  • Replace computer-use-demo/computer_use_demo/tools/computer.py with the modified version below
@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active October 29, 2025 13:25
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

@jinjier
jinjier / javdb-top250.md
Last active November 3, 2025 07:36
JavDB top 250 movies list. [Updated on 2025/10]

Rust Cheat Sheet

Variables & Mutability

Variables are immutable by default. This makes Rust safer and makes concurrency easier.
Immutable means once a value is bound to that variable, it cannot be changed.
For example:

fn main() {
 let x = 5;
@mmazzarolo
mmazzarolo / runtime-globals-checker.js
Last active June 8, 2023 14:27
Find what JavaScript variables are leaking into the global `window` object at runtime (see: https://mmazzarolo.com/blog/2022-02-14-find-what-javascript-variables-are-leaking-into-the-global-scope/)
/**
* RuntimeGlobalsChecker
*
* You can use this utility to quickly check what variables have been added (or
* leaked) to the global window object at runtime (by JavaScript code).
* By running this code, the globals checker itself is attached as a singleton
* to the window object as "__runtimeGlobalsChecker__".
* You can check the runtime globals programmatically at any time by invoking
* "window.__runtimeGlobalsChecker__.getRuntimeGlobals()".
*
@FbN
FbN / vite.config.js
Last active August 17, 2025 04:54
vite.config.js node built-in polyfills
// yarn add --dev @esbuild-plugins/node-globals-polyfill
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
// yarn add --dev @esbuild-plugins/node-modules-polyfill
import { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill'
// You don't need to add this to deps, it's included by @esbuild-plugins/node-modules-polyfill
import rollupNodePolyFill from 'rollup-plugin-node-polyfills'
export default {
resolve: {
alias: {