Skip to content

Instantly share code, notes, and snippets.

View arsdragonfly's full-sized avatar

Zheyu Shen arsdragonfly

View GitHub Profile
@arsdragonfly
arsdragonfly / game_of_life.rs
Created January 26, 2025 04:31
game of life Rust
#[bench]
fn game_of_life(b: &mut Bencher) {
// naive Vec implementation
const size_board_side: usize = 1024 * 8;
// 1d vec
let mut board = vec![0u8; size_board_side * size_board_side];
let mut next_state: Vec<u8> = vec![0; size_board_side * size_board_side];
// random initialization
// outermost ring is invalid
for i in 1..size_board_side - 1 {
@arsdragonfly
arsdragonfly / download_trivy_windows.py
Created September 12, 2025 19:58
Download Trivy on Windows
#!/usr/bin/env python3
"""
Download and extract Trivy Windows binary (trivy.exe) into a "trivy" folder.
Usage:
python download_trivy_windows.py [--version X.Y.Z]
If --version is omitted the script queries the GitHub API for the latest release.
"""
import argparse