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 December 19, 2025 15:28
Show dialogs from unmounted context
/*
* Show dialogs from unmounted context
* https://gist.github.com/PlugFox/f8f63c1ab3a63e49085b356281887435
* https://dartpad.dev?id=f8f63c1ab3a63e49085b356281887435
* Mike Matiunin <[email protected]>, 19 December 2025
*/
import 'dart:async';
import 'package:flutter/material.dart';
@PlugFox
PlugFox / main.dart
Last active December 9, 2025 15:54
Swipeable controller demo.
/*
* Swipeable controller demo.
* https://gist.github.com/PlugFox/39c051d807efb04759498033ce8452dc
* https://dartpad.dev?id=39c051d807efb04759498033ce8452dc
* Mike Matiunin <[email protected]>, 09 December 2025
*/
import 'dart:async';
import 'dart:math' as math;
@PlugFox
PlugFox / overlay.rs
Created December 8, 2025 20:45
Rust Windows Transparent Overlay
#[cfg(target_os = "windows")]
use windows::Win32::Foundation::{COLORREF, HINSTANCE, HWND, LPARAM, LRESULT, RECT, WPARAM};
#[cfg(target_os = "windows")]
use windows::Win32::Graphics::Dwm::DwmFlush;
#[cfg(target_os = "windows")]
use windows::Win32::Graphics::Gdi::HGDIOBJ;
#[cfg(target_os = "windows")]
use windows::Win32::Graphics::Gdi::*;
#[cfg(target_os = "windows")]
use windows::Win32::System::LibraryLoader::GetModuleHandleW;
@PlugFox
PlugFox / main.rs
Created December 8, 2025 20:42
Rust Windows Transparent Overlay
[package]
name = "transparent_overlay"
version = "0.1.1"
edition = "2021"
[dependencies]
windows = { version = "0.58", features = [
"Win32_Foundation",
"Win32_Graphics_Gdi",
"Win32_UI_WindowsAndMessaging",
@PlugFox
PlugFox / main.dart
Last active December 8, 2025 20:30
Dart async generator with StreamController
import 'dart:async';
void main() => gen().take(7).forEach(print);
Stream<String> gen() {
final controller = StreamController<String>();
void onCancel(void Function() fn) {
var temp = controller.onCancel ?? () {};
controller.onCancel = () {
@PlugFox
PlugFox / main.dart
Last active November 19, 2025 18:06
InkyIcon widget
/*
* InkyIcon widget.
* https://gist.github.com/PlugFox/097c35feb4cc3da7a4bce2d902b3a75b
* https://dartpad.dev?id=097c35feb4cc3da7a4bce2d902b3a75b
* Mike Matiunin <[email protected]>, 19 November 2025
*/
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@PlugFox
PlugFox / main.dart
Last active November 19, 2025 14:43
Superellipse Input Border for Flutter
/*
* Superellipse Input Border for Flutter
* https://gist.github.com/PlugFox/73fdd4f3d366a8f3e8662768226af36f
* https://dartpad.dev?id=73fdd4f3d366a8f3e8662768226af36f
* Mike Matiunin <[email protected]>, 19 November 2025
*/
import 'package:flutter/material.dart';
void main() => runApp(
@PlugFox
PlugFox / pdf.dart
Created November 12, 2025 18:58
Simple PDF Example
// dart run bin/make_pdf.dart
import 'dart:io';
import 'dart:typed_data';
void main() async {
final pdf = _PdfBuilder();
// Register built-in Type1 fonts (Base-14): Helvetica & Helvetica-Bold
final fontRegular = pdf.addRawObject(
'<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica /Encoding /WinAnsiEncoding >>',
@PlugFox
PlugFox / main.dart
Created November 11, 2025 20:18
dart linked list ffi benchmark
// ignore_for_file: avoid_print
import 'dart:ffi' as ffi;
import 'package:benchmark_harness/benchmark_harness.dart';
import 'package:ffi/ffi.dart';
// ============================================================================
// Pure Dart LinkedList Implementation
// ============================================================================
@PlugFox
PlugFox / main.dart
Last active October 21, 2025 13:03
Dart disposable
void Function() dispose = () {dispose = () {};};
void disposable(void Function() fn) {
final $ = dispose;
dispose = () {
try {
fn();
} finally {
$();
}
};