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
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
@PlugFox
PlugFox / main.dart
Created January 30, 2026 14:35
Dart extension type
/*
* Extension type
* https://gist.github.com/PlugFox/5593eafa163371223c7c2068266cc1b7
* https://dartpad.dev?id=5593eafa163371223c7c2068266cc1b7
* Mike Matiunin <plugfox@gmail.com>, 30 January 2026
*/
import 'dart:convert';
void main() {