Skip to content

Instantly share code, notes, and snippets.

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

Plague Fox PlugFox

🦊
🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊
View GitHub Profile
@PlugFox
PlugFox / example.dart
Last active April 23, 2024 13:40
Flutter Shimmer & Skeleton
void main() => runZonedGuarded<void>(
() => runApp(const App()),
(error, stackTrace) => log('Top level exception $error'),
);
class App extends StatelessWidget {
const App({super.key});
@override
Widget build(BuildContext context) => MaterialApp(
@PlugFox
PlugFox / main.dart
Last active April 22, 2024 15:14
Flutter HEX Color
void main() {
// Conver Dec to Hex
String dec2hex(int n) => n.toRadixString(16).toUpperCase();
// 32 bit number
int colorValue = 0xFFf2efed;
print('Hex color: ${dec2hex(colorValue)}');
print('Dec color: $colorValue');
// Extract colors
@PlugFox
PlugFox / main.dart
Created April 18, 2024 16:30
Focus example
/*
* Focus example
* https://gist.github.com/PlugFox/b533f61bbb0fa1a112dc36ad24361124
* https://dartpad.dev?id=b533f61bbb0fa1a112dc36ad24361124
* Mike Matiunin <plugfox@gmail.com>, 18 April 2024
*/
import 'dart:async';
import 'package:flutter/material.dart';
/// Dependencies
abstract interface class Dependencies {
/// The state from the closest instance of this class.
factory Dependencies.of(BuildContext context) => InheritedDependencies.of(context);
/// App metadata
abstract final AppMetadata appMetadata;
/// Database
abstract final Database database;
@PlugFox
PlugFox / example.dart
Last active April 12, 2024 13:46
Flutter get screenshot from canvas layer
import 'dart:async';
import 'dart:io';
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:gallery_saver/gallery_saver.dart';
import 'package:path/path.dart';
import 'package:path_provider/path_provider.dart';
import 'screenshot.dart';
@PlugFox
PlugFox / app_test.dart
Last active April 12, 2024 13:44
Flutter integration test screenshots (including Windows)
import 'dart:io' as io;
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'src/util/screenshot.dart';
void main() {
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();
@PlugFox
PlugFox / clickup.js
Created April 11, 2024 14:51
ClickUp Enhancements
// ==UserScript==
// @name ClickUp Enhancements
// @namespace plugfox
// @version 2024-04-11
// @description ClickUp Enhancements
// @author plugfox
// @run-at document-idle
// @homepage https://gist.github.com/PlugFox/608ef9f5caecf87c820d8ffd9468cc72
// @homepageURL https://gist.github.com/PlugFox/608ef9f5caecf87c820d8ffd9468cc72
// @match *://app.clickup.com/*
@PlugFox
PlugFox / main.dart
Last active April 9, 2024 12:01
Sunflower
/*
* Sunflower
* https://gist.github.com/PlugFox/9d251f3300804746884e2c2f8824babb
* https://dartpad.dev?id=9d251f3300804746884e2c2f8824babb
* Mike Matiunin <plugfox@gmail.com>, 06 March 2024
*/
import 'dart:async';
import 'dart:math' as math;
@PlugFox
PlugFox / script.js
Last active April 9, 2024 11:57
Bypass Medium paywall
// ==UserScript==
// @name medium-bypass
// @namespace plugfox
// @version 2024-03-19
// @description Bypass Medium paywall
// @author plugfox
// @run-at document-end
// @homepage https://gist.github.com/PlugFox/608ef9f5caecf87c820d8ffd9468cc72
// @homepageURL https://gist.github.com/PlugFox/608ef9f5caecf87c820d8ffd9468cc72
// @match *://medium.com/*
@PlugFox
PlugFox / telegram.bsl
Last active April 5, 2024 09:11
Отправка ТабличныйДокумент в телеграм
/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/// The MIT License
///
/// Copyright (c) 2019 Plague Fox
///
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is