Skip to content

Instantly share code, notes, and snippets.

View ziqq's full-sized avatar
💻
Coding

AntØn UstinØff ziqq

💻
Coding
  • beauty box
  • Georgia
View GitHub Profile
@ziqq
ziqq / script.js
Created May 5, 2024 18:42 — forked from PlugFox/script.js
Medium Dark Mode
// ==UserScript==
// @name medium-dark
// @namespace plugfox
// @version 2024-03-19
// @description Dark Mode for Medium
// @author plugfox
// @run-at document-start
// @homepage https://gist.github.com/PlugFox/0795e7ffb4fe4b190fafc734bc5a63a5
// @homepageURL https://gist.github.com/PlugFox/0795e7ffb4fe4b190fafc734bc5a63a5
// @match *://medium.com/*
@ziqq
ziqq / update_json_string.dart
Last active April 25, 2024 19:59
Update access_token in JSON String
/*
* Update JSON String
* https://gist.github.com/ziqq/19a6de0ef7db6ca96a0603e470c6cfc0
* https://dartpad.dev?id=19a6de0ef7db6ca96a0603e470c6cfc0
* Anton Ustinoff <a.a.ustinoff@gmail.com>, 25 April 2024
*/
import 'dart:convert';
void main() {
@ziqq
ziqq / main.dart
Created March 12, 2024 13:42 — forked from PlugFox/main.dart
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;
@ziqq
ziqq / main.dart
Created March 12, 2024 13:41 — forked from PlugFox/main.dart
Async expand example
/*
* Stream async expand
* https://gist.github.com/PlugFox/0366eb6d7bd2f3e03fd629c5a96ea8ff
* https://dartpad.dev?id=0366eb6d7bd2f3e03fd629c5a96ea8ff
* Mike Matiunin <plugfox@gmail.com>, 07 March 2024
*/
import 'dart:async';
import 'package:flutter/material.dart';
@ziqq
ziqq / main.dart
Created February 20, 2024 11:35 — forked from PlugFox/main.dart
Phone regexp
/*
* Phone formatter
* https://gist.github.com/PlugFox/198e8b02565541cfaec4e7e4e1d1359c
* https://dartpad.dev/198e8b02565541cfaec4e7e4e1d1359c
*
* ^(?<country>8|\+7|\+375)?[\-\s\.]*[(]?s?(?<region>[0-9]{1,5})s?[)]?[\-\s\.]*(?<abonent1>[\d]{2,5})[\-\s\.]*(?<abonent2>[\d]{2})[\-\s\.]*(?<abonent3>[\d]{2})[\s]+((доб|#|ext|вн)[а-яa-z\.]{0,7}[\s]?(?<ext>[\d]{1,5})?)?$
*/
/// Source phones
const List<String> phones = <String>[
@ziqq
ziqq / conditional_import.dart
Created February 15, 2024 13:11 — forked from PlugFox/conditional_import.dart
Firebase Remote Config - web implementation
/// Base interface
import 'remote_config_base.dart';
/// Conditional import
import 'remote_config_mobile.dart'
// ignore: uri_does_not_exist
if (dart.library.html) 'remote_config_web.dart';
...
final config = await getRemoteConfig();
@ziqq
ziqq / main.dart
Created February 15, 2024 13:04 — forked from PlugFox/main.dart
Date time parse and format as ISO-8601 with local timezone
/*
* Date time parse and format as ISO-8601 with local timezone
* https://gist.github.com/PlugFox/339bcd8dbec29a56fd53f8e0656e4a54
* https://dartpad.dev/339bcd8dbec29a56fd53f8e0656e4a54?id=&null_safety=true
*/
import 'dart:async';
import 'package:intl/intl.dart' as intl;
const String source = '2021-01-02T03:08:04+02:30';
@ziqq
ziqq / main.dart
Created February 15, 2024 13:04 — forked from PlugFox/main.dart
Generate from CSV, TSV
/*
* Generate from CSV, TSV
* https://gist.github.com/PlugFox/d488cef8f605e5b7ea3433d49fd21f00
* https://dartpad.dev/d488cef8f605e5b7ea3433d49fd21f00?id=&null_safety=true
*/
import 'dart:math' as math;
void main() {
final list = data.split('\n').toList();
final space = ' '.codeUnits.first;
@ziqq
ziqq / main.dart
Created February 15, 2024 13:03 — forked from PlugFox/main.dart
PageView example with dots indicator
// Copyright 2017, the Flutter project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(new MyApp());
}
@ziqq
ziqq / jwt.dart
Created February 13, 2024 13:05 — forked from PlugFox/jwt.dart
JWT Hmac SHA256 HS256
import 'dart:collection';
import 'dart:convert';
import 'dart:typed_data';
import 'package:collection/collection.dart';
import 'package:crypto/crypto.dart';
import 'package:meta/meta.dart';
/// Токен JWT состоит из трех частей: заголовка (header), полезной нагрузки (payload) и подписи или данных шифрования.
/// Первые два элемента — это JSON объекты определенной структуры.