Skip to content

Instantly share code, notes, and snippets.

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

Plague Fox PlugFox

🦊
🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊
View GitHub Profile
@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() {
@PlugFox
PlugFox / sse.dart
Last active January 30, 2026 13:02
Dart Server-sent events
import 'dart:async';
import 'dart:convert' show Utf8Decoder, JsonDecoder;
import 'dart:math' as math;
import 'package:flutter/foundation.dart' show ValueListenable, ValueNotifier;
import 'package:meta/meta.dart';
import 'api_client.dart';
/// A typedef representing a Server-Sent Event (SSE) event.
@PlugFox
PlugFox / main.dart
Last active January 13, 2026 13:52
Questions example
/*
* Questions example
* https://gist.github.com/PlugFox/66bca21faaaf8613857ade983c78a47b
* https://dartpad.dev?id=66bca21faaaf8613857ade983c78a47b
* Mike Matiunin <plugfox@gmail.com>, 13 January 2026
*/
// ignore_for_file: curly_braces_in_flow_control_structures, avoid_print
import 'dart:async';
@PlugFox
PlugFox / main.dart
Last active January 13, 2026 13:09
Pop and push demo
/*
* Pop and Push Demo
* https://gist.github.com/PlugFox/52c08d44d4074d37c236528b058eedd7
* https://dartpad.dev?id=52c08d44d4074d37c236528b058eedd7
* Mike Matiunin <plugfox@gmail.com>, 13 January 2026
*/
import 'dart:async';
import 'package:flutter/material.dart';