Skip to content

Instantly share code, notes, and snippets.

View undefined443's full-sized avatar
:octocat:

Xiao Li undefined443

:octocat:
  • Sun Yat-sen University
  • Guangzhou, Guangdong, China
  • 15:03 (UTC +08:00)
  • LinkedIn in/xiaoli3397
View GitHub Profile
@undefined443
undefined443 / evaluator.py
Created February 11, 2026 23:10
OpenAI's evaluator for generative models — computes FID, sFID, IS, Precision & Recall from .npz sample batches using InceptionV3 features. From [openai/guided-diffusion](https://github.com/openai/guided-diffusion/tree/main/evaluations). Usage: `python evaluator.py ref_batch.npz sample_batch.npz`
# /// script
# requires-python = ">=3.13.0"
# dependencies = [
# "tensorflow[and-cuda]",
# "scipy",
# "requests",
# "tqdm"
# ]
# ///
import argparse
@undefined443
undefined443 / passwd2ldif.py
Created December 9, 2025 07:52
Convert /etc/passwd to LDIF format
#!/usr/bin/env python3
"""
Script to convert passwd file to LDIF format
"""
import argparse
def parse_gecos(gecos):
"""Parse GECOS field to extract full name"""
@undefined443
undefined443 / QWERTY no option.keylayout
Created November 5, 2025 18:25 — forked from greneholt/QWERTY no option.keylayout
Mac QWERTY keyboard layout without bindings for the option key. This disables the annoying default behavior of key combinations like option+i that enters diacritic mode and prevents using such shortcuts in VS Code.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<keyboard group="0" id="5000" name="QWERTY no option" maxout="1">
<layouts>
<layout first="0" last="0" modifiers="48" mapSet="312" />
</layouts>
<modifierMap id="48" defaultIndex="0">
<keyMapSelect mapIndex="0">
<modifier keys="" />
</keyMapSelect>