Skip to content

Instantly share code, notes, and snippets.

"""
Reproduce grouped_mm stride validation failure with x.shape[0] == 0.
This models the _run_experts_grouped_mm pattern from torchtitan's MoE layer
where Expert Parallelism can result in zero tokens being routed to a rank.
The bug: the backward pass of _grouped_mm calls _grouped_mm on a transposed
(K, 0) tensor. When a dim is 0, PyTorch assigns strides of 0 for that dim,
producing strides (0, 0). This fails the stride validation which requires
either row-major or column-major layout (i.e. at least one stride must be 1).
@elainechan
elainechan / tic_tac_toe.py
Created February 12, 2026 21:32
Tic Tac Toe
def print_board(board):
for i in range(0, 9, 3):
print(" | ".join(board[i:i+3]))
if i < 6:
print("---------")
def check_winner(board):
wins = [
[0,1,2], [3,4,5], [6,7,8], # rows
[0,3,6], [1,4,7], [2,5,8], # columns
@Yuji-HAMADA
Yuji-HAMADA / gallary_data.json
Created February 12, 2026 21:32
Gallery Data (100 items) for @s_ruiko (all) on 2026/02/12-21:32:18-JST
[
{
"full_text": "RT @yushakei_PJ: ━━ ⚡︎ キャンペーン開催 ⚡︎ ━━\n TVアニメ『#勇者刑に処す』\n 第5話放送記念キャンペーン\n━━━━━━━━━━━━━━\n\nフォロー&RPで\nキャストサイン入り台本をプレゼント\n\n▼第6話サインキャスト\nザイロ(#阿座上洋平)\nテオリッタ(#飯塚麻結)\n\n▼締め切り\n2/18(水)23:59まで",
"created_at": "2026-02-12T14:01:00.000Z",
"media_urls": [
"https://pbs.twimg.com/media/HA8-4oqbAAEFaIC?format=jpg&name=small"
],
"id_str": "2021947649847378053"
},
{
@JCaesar45
JCaesar45 / index.html
Created February 12, 2026 21:31
Factorize | Mathematical Prime Engine
The MIT License (MIT)
Copyright (c) 2026 Jordan Leturgez (https://codepen.io/JCaesar45/pen/gbMqdLg)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
import numpy as np
from sklearn.metrics import (
roc_auc_score, average_precision_score, f1_score,
precision_score, recall_score, accuracy_score, matthews_corrcoef
)
def get_all_metrics(y_true, y_score, labels, threshold=0.5):
y_pred = (y_score >= threshold).astype(int)
res = {}
@forkyau
forkyau / hourly_rainfall_data-2026-02-13|05-15.csv
Created February 12, 2026 21:31
GIST created by python code
id station stationid value unit obstime date
0 流浮山 RF001 0 mm 2026-02-13T05:15:00+08:00 2026-02-13
1 湿地公园 RF002 0 mm 2026-02-13T05:15:00+08:00 2026-02-13
2 水边围 N12 0 mm 2026-02-13T05:15:00+08:00 2026-02-13
3 石岗 RF003 0 mm 2026-02-13T05:15:00+08:00 2026-02-13
4 大美督 RF004 0 mm 2026-02-13T05:15:00+08:00 2026-02-13
5 大埔墟 RF005 0 mm 2026-02-13T05:15:00+08:00 2026-02-13
6 北潭涌 RF006 0 mm 2026-02-13T05:15:00+08:00 2026-02-13
7 滘西洲 RF007 0 mm 2026-02-13T05:15:00+08:00 2026-02-13
8 西贡 N15 0 mm 2026-02-13T05:15:00+08:00 2026-02-13
@ferrata
ferrata / openapi.yaml
Created February 12, 2026 21:30
OpenAPI spec for PR #2338
openapi: 3.1.0
info:
title: Makeswift API
description: Documentation for the Makeswift public REST API.
version: '1.0'
servers:
- url: 'https://api.makeswift.com'
description: Production server
paths:
/v1/workspaces:
@thebrokegeniusco-sys
thebrokegeniusco-sys / test_gist.md
Created February 12, 2026 21:30
Test gist for GitHub CLI capabilities demo

GitHub CLI Test\nThis is a test gist created via GitHub CLI to demonstrate its capabilities.

@rustinpartow
rustinpartow / slides_standalone.html
Created February 12, 2026 21:30
Search Quality Judge — LLM-as-a-Judge slide deck
<!DOCTYPE html><html lang="en-US"><head><title>Search Quality Judge</title><meta property="og:title" content="Search Quality Judge"><meta charset="UTF-8"><meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0"><meta name="apple-mobile-web-app-capable" content="yes"><meta http-equiv="X-UA-Compatible" content="ie=edge"><meta property="og:type" content="website"><meta name="twitter:card" content="summary"><style>@media screen{body[data-bespoke-view=""] .bespoke-marp-parent>.bespoke-marp-osc>button,body[data-bespoke-view=next] .bespoke-marp-parent>.bespoke-marp-osc>button,body[data-bespoke-view=presenter] .bespoke-marp-presenter-container .bespoke-marp-presenter-info-container button,body[data-bespoke-view=presenter] .bespoke-marp-presenter-container .bespoke-marp-presenter-note-container button{appearance:none;background-color:initial;border:0;color:inherit;cursor:pointer;font-size:inherit;opacity:.8;outline:none;padding:0;transition:opacity .2s linear;-webkit-tap-highlight-colo
@HugsLibRecordKeeper
HugsLibRecordKeeper / output_log.txt
Created February 12, 2026 21:30
Rimworld output log published using HugsLib
Log uploaded on Friday, February 13, 2026, 5:30:24 AM
Loaded mods:
Harmony(brrainz.harmony)[mv:2.4.2.0]: 0Harmony(2.4.1), HarmonyMod(2.4.2)
Core(Ludeon.RimWorld): (no assemblies)
Royalty(Ludeon.RimWorld.Royalty): (no assemblies)
Ideology(Ludeon.RimWorld.Ideology): (no assemblies)
Biotech(Ludeon.RimWorld.Biotech): (no assemblies)
Anomaly(Ludeon.RimWorld.Anomaly): (no assemblies)
Odyssey(Ludeon.RimWorld.Odyssey): (no assemblies)
HugsLib(UnlimitedHugs.HugsLib)[ov:12.0.0]: 0Harmony(av:2.4.1,fv:1.2.0.1), HugsLib(av:1.0.0,fv:12.0.0)