Skip to content

Instantly share code, notes, and snippets.

View razhangwei's full-sized avatar

Wei Zhang razhangwei

  • Facebook
  • Bay Area
View GitHub Profile
@razhangwei
razhangwei / github.md
Last active August 29, 2025 01:55
How to read .github folder in a Github repo

Awesome — we’ll cover the .github/ folder from a reader’s POV: what it is, how it changes what you see on GitHub, and how to quickly make sense of it in any repo.

What the .github/ folder is • Purpose: holds GitHub-specific config (templates, automation, repo metadata). It doesn’t ship in packages or affect runtime code. • Scope: affects issues, PRs, Discussions, security disclosures, CI (GitHub Actions), and repo presentation.

How it changes your experience • Issues/PRs: you’ll see structured forms or prefilled text when opening issues/PRs. • Automation: PRs may auto-label, auto-assign reviewers, run checks/tests, or block merges. • Docs & policies: contribution rules, code of conduct, and security reporting paths show up in dedicated UI entries.

@razhangwei
razhangwei / pyproject.toml.md
Created August 28, 2025 15:07
How to read pyproject.toml

Great question 👍. A pyproject.toml file looks intimidating at first, but it’s just a TOML-formatted config. The trick is to know the sections that matter.

How to Read a pyproject.toml

  1. Build system

[build-system] requires = ["setuptools>=61.0"]

@razhangwei
razhangwei / python_package.md
Last active August 28, 2025 15:04
How to read a python package/repo?
Category File / Directory Purpose
Configuration & Build .gitignore Specifies files/folders Git should ignore.
Configuration & Build .pre-commit-config.yaml Defines linting/formatting hooks for pre-commit.
Configuration & Build .pylintrc Config file for pylint (style/linting rules).
Configuration & Build tox.ini Automates testing across multiple environments.
Configuration & Build pyproject.toml Defines packaging, dependencies, and build system.
Configuration & Build Dockerfile Provides containerized build/runti
  • process isolation
  • For Linux and WSL.
@razhangwei
razhangwei / codex.md
Created August 6, 2025 07:01
OpenAI Codex #ai-agent
  • Async, cloud-based AI agent.

Concepts:

  • environment

vs Claude Code

@razhangwei
razhangwei / clean_up.sh
Created April 8, 2025 03:32
Clean up common coding related cache (uv, huggingface, npm, homebrew)
#!/bin/bash
# === Cache Cleanup Script ===
# Cleans caches for Homebrew, UV, Hugging Face, and NPM
# Usage: bash cleanup.sh [options]
# Options:
# -a, --all Clean all caches
# -b, --brew Clean Homebrew cache
# -u, --uv Clean UV cache
# -h, --huggingface Clean Hugging Face cache
@razhangwei
razhangwei / huggingface.md
Last active March 31, 2025 02:49
Transformer models published on Huggingface

How can I find the model implementation for a particular model?

  • Usually it's avaiable from transformers/models/xxxx, e.g., for qwen2_5_vl
@razhangwei
razhangwei / qwen2.5-vl.py
Last active March 31, 2025 00:29
qwen2.5-vl pseudo code #window attention
from typing import List, Tuple, Optional, Union, Callable
import numpy as np
# Define a Tensor type for clarity in this pseudocode
Tensor = np.ndarray # In real implementation, this would be a framework-specific tensor type
# Qwen2.5-VL Vision Encoder Pseudocode
class Qwen25VisionEncoder:
def __init__(self,
@razhangwei
razhangwei / website_cheatsheet.md
Last active March 10, 2025 03:15
Modern Personal Website Tech Stack Cheatsheet #nextjs #react #typescript #tailwindcss

Personal Website Tech Stack Cheatsheet

Core Technologies

Technology Version Purpose
Next.js 14.2.0 React framework with file-based routing, static site generation
React 18.2.0 UI library for component-based development
TypeScript 5.3.3 Static type-checking for JavaScript
TailwindCSS 3.4.1 Utility-first CSS framework
@razhangwei
razhangwei / walrus.md
Created March 5, 2025 17:41
#Python Walrus operator

The Walrus Operator in Python: A Comprehensive Guide

The walrus operator (:=) was introduced in Python 3.8 as part of PEP 572. It's officially called the "assignment expression" operator, but it earned its nickname because := resembles a walrus with tusks when viewed sideways. This operator allows you to assign values to variables as part of an expression, rather than as a separate statement.

Basic Syntax and Purpose

The syntax is:

variable := expression