View main.dart
This file contains 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
/* | |
* Format input date | |
* https://gist.github.com/PlugFox/9364d6a88d0baf1284e4cdc0581957e7 | |
* https://dartpad.dev/9364d6a88d0baf1284e4cdc0581957e7 | |
* Matiunin Mikhail <plugfox@gmail.com>, 27 January 2023 | |
*/ | |
void main() => [ | |
'', | |
'.', |
View tasks.json
This file contains 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
{ | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"type": "flutter", | |
"command": "flutter", | |
"options": { | |
"cwd": "packages/sd_market/" | |
}, | |
"args": [ |
View shortcuts.json
This file contains 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
[ | |
{ | |
"key": "shift+alt+`", | |
"command": "workbench.action.showCommands" | |
}, | |
{ | |
"key": "shift+cmd+p", | |
"command": "-workbench.action.showCommands" | |
}, | |
{ |
View chunker.dart
This file contains 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:math' as math; | |
import 'dart:typed_data' as td; | |
import 'package:meta/meta.dart'; | |
/// {@template chunker} | |
/// Chunker stream transformer | |
/// {@endtemplate} | |
@immutable |
View main.dart
This file contains 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:math' as math; | |
import 'dart:typed_data' as td; | |
import 'package:meta/meta.dart'; | |
/// {@template chunker} | |
/// Chunker stream transformer | |
/// {@endtemplate} | |
@immutable |
View cbz.sh
This file contains 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
#! /bin/zsh | |
# Usage: Zips given directories into .cbz (Comic Book ZIP) archives of the smame name (eg "folder name.cbz"). | |
# How to make public: | |
# 1. chmod +x cbz.sh | |
# 2. mv cbz.sh /usr/local/bin/cbz | |
# 3. cbz -h | |
complete="/System/Applications/Music.app/Contents/Resources/complete.aif" | |
remove_flag="m" |
View qbittorrent.sh
This file contains 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
#! /bin/zsh | |
docker stop qbittorrent | |
docker rm qbittorrent | |
mkdir -p $PWD/qbittorrent/{config,torrents,downloads} | |
# --rm --net=host --restart unless-stopped --user $UID:$GID \ | |
docker run -d \ | |
--name qbittorrent \ |
View api.dart
This file contains 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
/* ... */ | |
mixin _LocalStorageAPI on _LocalStorageCache { | |
Future<String?> getString(String key) => _eval<String?>((db) => db.getString(key)); | |
Future<void> setString(String key, String value) => _eval<void>((db) => db.setString(key, value)); | |
} |
View stateless.dart
This file contains 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:flutter/widgets.dart'; | |
class Example extends StatelessWidget { | |
const Example({super.key}); | |
@override | |
StatelessElement createElement() => ExampleElement(this); | |
@override | |
Widget build(BuildContext context) => const Placeholder(); |
View database.dart
This file contains 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
/// Key-value storage interface for SQLite database | |
abstract class IKeyValueStorage { | |
Future<void> refresh(); | |
String? getKey(String key); | |
void addKey(String key, String value); | |
void removeKey(String key); |
NewerOlder