Skip to content

Instantly share code, notes, and snippets.

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

Plague Fox PlugFox

🦊
🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊🦊
View GitHub Profile
@PlugFox
PlugFox / json.sql
Created May 22, 2024 17:09
SQLITE JSON GENERATED STORED COLUMN EXAMPLE
CREATE TABLE IF NOT EXISTS offer_history (
/* Primary keys */
-- req offer_history id
id TEXT NOT NULL PRIMARY KEY CHECK(id <> '' AND id = (data ->> '$.id')),
/* Raw JSON data */
-- req Raw json data
data TEXT NOT NULL CHECK(data <> '' AND length(data) > 5),
@PlugFox
PlugFox / README.md
Last active May 11, 2024 00:27
Repair and wipe Flutter

Wipe all flutter data

nohup bash -c 'rm -rf ~/.pub-cache $PUB_CACHE \
  && cd $(dirname -- $(which flutter)) \
  && git clean -fdx \
  && (yes | flutter doctor --android-licenses)' > /dev/null 2>&1 & 
@PlugFox
PlugFox / benchmark.dart
Last active May 10, 2024 22:55
Enum utils
import 'package:benchmark_harness/benchmark_harness.dart';
void main() {
final letter = Example.values[25];
final simple = Simple(letter).measure();
final cache = Cache(letter).measure();
print('$simple / $cache = ${simple / cache}'); // 4.074025631823892
}
enum Example {
@PlugFox
PlugFox / main.dart
Last active May 9, 2024 06:12
Hexagons, proof of concept
// ignore_for_file: avoid_print
import 'dart:async';
import 'dart:math' as math;
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
// TODO(plugfox): пропадают элементы снизу при скролле и определенных размерах экранах
// TODO(plugfox): добавить скролл при наведении мыши на края экрана
@PlugFox
PlugFox / main.dart
Last active May 5, 2024 15:25
Seat Viewer
/*
* Seat Viewer
* https://gist.github.com/PlugFox/218f5884cf61130433cd684783fd58b7
* https://dartpad.dev?id=218f5884cf61130433cd684783fd58b7
* Mike Matiunin <plugfox@gmail.com>, 05 May 2024
*/
import 'dart:math' as math;
import 'package:flutter/foundation.dart' show listEquals;
@PlugFox
PlugFox / main.dart
Created May 3, 2024 21:36
Dart: base class and mixins
void main() => D().close();
abstract base class A {
A() {
print('A:constructor');
init();
}
void init() {
print('A:init');
@PlugFox
PlugFox / крохотулька.bsl
Created May 1, 2024 15:03
Крохотулька (Склонение по Падежам в 1С)
// Удаление этих строк незнаконно!
// Гарантия 91 года и 1 месяц!!!
// Послегарантийное обслуживание - бесплатно!!!
// Круглосуточная поддержка - все 48 часов в бою!
// Ссылка на источник обязательна!
// Эти программы защищены законом об авторских правах. Запрещается перепродажа данной программы.
// ПРОВЕРЕНО! ВИРУСОВ НЕТ!!! АНТИВИРУСОВ ТОЖЕ!!!
// Смотри Милячуша в творительном !!
// скупой слепой тупой - пропой!!
// !№№!
@PlugFox
PlugFox / main.dart
Last active April 26, 2024 18:31
rAthena Warper to OpenKore portals.txt
/*
* rAthena Warper to OpenKore portals.txt
* https://gist.github.com/PlugFox/31069d30374670557a023c557793f121
* https://dartpad.dev?id=31069d30374670557a023c557793f121
* Mike Matiunin <plugfox@gmail.com>, 26 April 2024
*/
// ignore_for_file: avoid_print, lines_longer_than_80_chars, curly_braces_in_flow_control_structures
void main() {
@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';