π¦
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:typed_data' show Uint8List; | |
| import 'package:meta/meta.dart' show immutable; | |
| import 'drop_zone_stream_vm.dart' | |
| // ignore: uri_does_not_exist | |
| if (dart.library.js_interop) 'drop_zone_stream_js.dart'; | |
| /// {@template drop_zone_event} | |
| /// Events emitted by the [DropZone] stream. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:doctorina/src/profile/model/profile_data_codecs.dart'; | |
| import 'package:flutter/foundation.dart'; | |
| typedef ProfileId = String; | |
| @immutable | |
| class Profile { | |
| const Profile({ | |
| required this.id, | |
| required this.name, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ignore_for_file: avoid_print | |
| /* | |
| * Date <==> Int conversion | |
| * https://gist.github.com/PlugFox/a94be8655b2adb91336f03bc77513d76 | |
| * https://dartpad.dev?id=a94be8655b2adb91336f03bc77513d76 | |
| * Mike Matiunin <plugfox@gmail.com>, 20 March 2025 | |
| */ | |
| /// Date extension type |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Auto Scroll Toggle for comick.io | |
| // @namespace plugfox | |
| // @version 1.3 | |
| // @description Toggle auto scroll on and off with a hotkey, and stop on page blur | |
| // @author @plugfox | |
| // @run-at document-idle | |
| // @homepage https://gist.github.com/PlugFox/7315cad8ef028e2751f4a971ca9d59e9 | |
| // @homepageURL https://gist.github.com/PlugFox/7315cad8ef028e2751f4a971ca9d59e9 | |
| // @match *://comick.io/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:convert'; | |
| import 'package:crypto/crypto.dart'; | |
| import 'package:meta/meta.dart'; | |
| /// {@template jwt} | |
| /// A JWT token consists of three parts: the header, | |
| /// the payload, and the signature or encryption data. | |
| /// The first two elements are JSON objects of a specific structure. | |
| /// The third element is calculated based on the first two |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// Dependencies | |
| abstract interface class Dependencies { | |
| /// The state from the closest instance of this class. | |
| factory Dependencies.of(BuildContext context) => InheritedDependencies.of(context); | |
| /// Database | |
| abstract final Database database; | |
| } | |
| final class $MutableDependencies implements Dependencies { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ignore_for_file: curly_braces_in_flow_control_structures | |
| /* | |
| * Performance benchmark of different ways to append data to a list. | |
| * https://gist.github.com/PlugFox/9849994d1f229967ef5dc408cb6b7647 | |
| * | |
| * BytesBuilder | builder.add(chunk) | 7 us. | |
| * AddAll | list.addAll(chunk) | 594 us. | |
| * Spread | [...list, ...chunk] | 1016446 us. | |
| * Concatenation | list + chunk | 1005022 us. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM dart:stable AS build_dart | |
| WORKDIR /app | |
| COPY ./tool/ ./tool/ | |
| RUN dart compile exe tool/web_env.dart -o tool/web-env | |
| FROM plugfox/flutter:stable-web AS build_web |
NewerOlder