Skip to content

Instantly share code, notes, and snippets.

View suxue's full-sized avatar

FEI Hao suxue

  • CSIT of ANU
  • ACT, Australia
View GitHub Profile
# =============================================
# Git Worktree 快速管理助手
# 用法:
# ga <branch-name> # 在平行目录创建新 worktree + 新分支,并自动 cd 进去
# gd # 删除当前 worktree 和对应分支(带确认)
#
# 依赖:
# - gum[](https://github.com/charmbracelet/gum) 用于美观的确认对话框
# - mise (可选,如果你用 mise 管理工具版本)
# =============================================
@intellectronica
intellectronica / 0.README.md
Last active December 21, 2025 09:56
SKILL: Fetch YouTube Transcript

YouTube Transcript SKILL

Get youtube-transcript.zip

Use this skill to fetch the transcript of a YouTube video, with or without timestamps.

Use this skill with Claude (by extracting it to .claude/skills/) or with any other agent using Skillz.

Note: This skill is unlikely to run successfully on the Claude web app, since access to YouTube is blocked. Use it with Claude Code or other local agents.

@glennmatlin
glennmatlin / claude_code_hooks_for_uv.md
Last active December 19, 2025 03:53
Claude Code hooks for working with `uv`

Claude Code Hooks for working with uv

by Glenn Matlin / glennmatlin on all socials

Installation

  1. Download and copy all files in this gist to ~/.claude/
  2. Move the .py files to ~/.claude/hooks
  3. Restart Claude Code.
@Chillee
Chillee / create_block_mask.py
Created October 30, 2024 00:17
Compiling `create_block_mask`
import torch
from triton.testing import do_bench
from torch.nn.attention.flex_attention import create_block_mask, flex_attention, noop_mask
torch.manual_seed(0)
import torch
torch.set_default_device('cuda')
def sliding_window(b, h, q_idx, kv_idx):
@natolambert
natolambert / skyworks-rewardbench-contamination.md
Last active February 18, 2025 03:56
MagPie RewardBench Contamination (found through SkyWorks Preferences)

Recently, I learned that some of the top reward models on RewardBench were trained on a preference dataset that has unintentional contamination with the benchmark. The dataset, Skyworks Preferences 80k contains contamination by mixing a Magpie dataset in. Magpie is a new method for having language models generate instructions by prompting them with an empty chat template. The source for the Skyworks dataset that was contaminated is Argilla/magpie-ultra-v0.1, generated with Llama 3.1 405B Instruct. I would never expect a Magpie dataset to be contaminated.

What seems likely is that Meta trained on some these prompts, but the exact provenance of each prompt needs more example. For example, we learned that some of the prompts we used in our LLMBar subsets they got from popular training sets like Al

@FeepingCreature
FeepingCreature / youre_doing_json_apis_wrong.md
Last active December 25, 2025 12:06
You Are Doing JSON APIs Wrong

You are doing JSON APIs wrong.

When you use JSON to call an API - not a REST API, but something like JSON-RPC - you will usually want to encode one of several possible messages.

Your request body looks like this:

{
 "type": "MessageWithA",
@luistung
luistung / tokenization.cpp
Created October 11, 2019 12:02
c++ version of bert tokenize
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <unordered_map>
#include <boost/algorithm/string.hpp>
#include <utf8proc.h>
//https://unicode.org/reports/tr15/#Norm_Forms
//https://ssl.icu-project.org/apiref/icu4c/uchar_8h.html
@stefan-it
stefan-it / run_ner.py
Last active April 2, 2022 13:28
NER fine-tuning with PyTorch-Transformers (heavily based on https://github.com/kamalkraj/BERT-NER)
from __future__ import absolute_import, division, print_function
import argparse
import glob
import logging
import os
import random
import numpy as np
import torch
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active December 27, 2025 06:03
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@fnky
fnky / ANSI.md
Last active December 30, 2025 11:14
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27