Skip to content

Instantly share code, notes, and snippets.

View PlugFox's full-sized avatar
🦊
🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊

Plague Fox PlugFox

🦊
🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊
View GitHub Profile
@PlugFox
PlugFox / README.md
Created September 29, 2026 12:06
flutter/flutter#193388 and #193389: Impeller MetalSDF isAntiAlias and FlutterFragCoord shift reproductions

flutter/flutter#193388 and #193389: reproductions

  • coord.frag encodes FlutterFragCoord() in red and green (one period per 8 px), so every pixel's expected value is known.
  • repro_193388.dart is the reproduction from #193388, verbatim.
  • sweep.dart sweeps the fractional part of the rect's origin and prints the mean offset, in px, between the coordinate the shader saw and the pixel centre. It covers pixels at least 2 px inside a 40Γ—16 rect. The SDF arm is the default isAntiAlias = true. The direct arm is isAntiAlias = false with the #193388 primer. The last column counts pixels where the two arms differ.

Setup: flutter create --platforms=macos --empty repro, put coord.frag in shaders/, and add to pubspec.yaml:

flutter:
@PlugFox
PlugFox / README.md
Last active July 15, 2026 22:40
Dart vs TypeScript для WebGPU-ΠΈΠ³Ρ€Ρ‹ Π½Π° three.js

Dart vs TypeScript для WebGPU-ΠΈΠ³Ρ€Ρ‹ Π½Π° three.js

Π‘Ρ€Π°Π²Π½Π΅Π½ΠΈΠ΅ TypeScript (Bun), Dartβ†’JS (dart2js) ΠΈ Dartβ†’WASM (dart2wasm) ΠΊΠ°ΠΊ host-языков, Π³ΠΎΠ½ΡΡŽΡ‰ΠΈΡ… настоящий three.js WebGPURenderer. ВсС Ρ€Π΅Π°Π»ΠΈΠ·Π°Ρ†ΠΈΠΈ крутят ΠΎΠ΄ΠΈΠ½ ΠΈ Ρ‚ΠΎΡ‚ ΠΆΠ΅ Π΄Π²ΠΈΠΆΠΎΠΊ; three.js β€” ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ‡Π½ΠΎΠ΅ tree-shaken подмноТСство, Ρ‚Π°ΠΊ Ρ‡Ρ‚ΠΎ Ρ€Π°Π·Π½ΠΈΡ†Π° Π² Ρ€Π°Π·ΠΌΠ΅Ρ€Π΅ = ΠΊΠΎΠ΄ прилоТСния + Ρ€Π°Π½Ρ‚Π°ΠΉΠΌ языка, Π° Ρ€Π°Π·Π½ΠΈΡ†Π° Π² CPU-Π²Ρ€Π΅ΠΌΠ΅Π½ΠΈ = host-язык (GPU-ΠΏΡƒΡ‚ΡŒ ΠΎΠ±Ρ‰ΠΈΠΉ).

Dart-сторона ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅Ρ‚ extension type + dart:js_interop ΠΏΠΎΠ²Π΅Ρ€Ρ… globalThis.THREE (Ρ€ΡƒΡ‡Π½Ρ‹Π΅ Π±ΠΈΠ½Π΄ΠΈΠ½Π³ΠΈ). TS ΠΈΠΌΠΏΠΎΡ€Ρ‚ΠΈΡ€ΡƒΠ΅Ρ‚ three/webgpu Π½Π°ΠΏΡ€ΡΠΌΡƒΡŽ.

@PlugFox
PlugFox / clean-builds.sh
Created April 23, 2026 22:06
Clean builds script
#!/usr/bin/env bash
# Clean build/cache directories for Dart, TS, Rust and other common tooling.
# Usage:
# ./clean-builds.sh # dry-run: shows what would be deleted and total size
# ./clean-builds.sh --apply # actually delete
# ./clean-builds.sh --apply -y # delete without confirmation
set -euo pipefail
ROOT="${ROOT:-$(pwd)}"
@PlugFox
PlugFox / README.md
Created April 7, 2026 23:52
ChatScrollView vs ListView.builder β€” Benchmark Report

ChatScrollView vs ListView.builder β€” Benchmark Report

Environment

  • Flutter 3.32.2, Dart 3.8.2, macOS ARM64
  • Viewport: 400x800 logical pixels
  • Test runner: flutter test (headless, no GPU compositing)
  • Date: 2026-04-08
  • 42 tests, all passing
@PlugFox
PlugFox / main.dart
Last active March 29, 2026 12:41
Sunflower V2 β€” 100K animated dots on a single layer with spring physics
/*
* Sunflower V2 β€” 100K animated dots on a single layer with spring physics.
* https://gist.github.com/PlugFox/0a0ee8ba7dc3679b86f2d8b4aab01569
* https://dartpad.dev?id=0a0ee8ba7dc3679b86f2d8b4aab01569
* Mike Matiunin <plugfox@gmail.com>, 26 March 2026
*/
//ignore_for_file: curly_braces_in_flow_control_structures
import 'dart:async';
@PlugFox
PlugFox / id_pool.dart
Created March 25, 2026 07:53
Id Pool for Dart & Flutter
import 'dart:typed_data';
/// ΠŸΡƒΠ» ΠΎΠ±ΡŠΠ΅ΠΊΡ‚ΠΎΠ² с цСлочислСнными ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€Π°ΠΌΠΈ ΠΈ ΠΏΠ΅Ρ€Π΅ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ΠΌ ID.
///
/// Π’Π½ΡƒΡ‚Ρ€Π΅Π½Π½Π΅Π΅ устройство (sparse-set + recycle-stack):
///
/// β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
/// β”‚ sparse β”‚ id ──▢ β”‚ dense β”‚ dense idx ──▢ data[idx]
/// β”‚Uint32Listβ”‚ β”‚Uint32Listβ”‚
/// β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
@PlugFox
PlugFox / main.dart
Created March 24, 2026 08:55
Form State Management
/*
* Form State Management
* https://gist.github.com/PlugFox/eed8aaa9fe83a032f17139e8b1814986
* https://dartpad.dev/?id=eed8aaa9fe83a032f17139e8b1814986
*/
import 'package:flutter/material.dart';
void main() {
runApp(const App());
@PlugFox
PlugFox / main.dart
Last active March 17, 2026 12:30
Password validation
/*
* Password validation
* https://gist.github.com/PlugFox/b6aa1d256e6900424c74aa75136c9aef
* https://dartpad.dev?id=b6aa1d256e6900424c74aa75136c9aef
* Mike Matiunin <plugfox@gmail.com>, 17 March 2026
*/
// ignore_for_file: curly_braces_in_flow_control_structures
void main() {
@PlugFox
PlugFox / main.dart
Last active March 13, 2026 14:00
SliverLayout
/*
* SliverLayout
* https://gist.github.com/PlugFox/53636071587beeff1527f1ff48e5a969
* https://dartpad.dev?id=53636071587beeff1527f1ff48e5a969
* Mike Matiunin <plugfox@gmail.com>, 13 March 2026
*/
// ignore_for_file: library_private_types_in_public_api
import 'dart:math' as math;
@PlugFox
PlugFox / get_ios_rating.dart
Last active March 13, 2026 07:09
Collect AppStore rating
import 'dart:convert';
import 'dart:io' as io;
import 'package:http/http.dart' as http;
final $log = io.stdout.writeln; // Log to stdout
final $err = io.stderr.writeln; // Log to stderr
void main() => Future<void>(() async {
const appId = "6743122346"; // Doctorina app ID on the App Store, without the 'id' prefix