Skip to content

Instantly share code, notes, and snippets.

View AlexV525's full-sized avatar
🌍
typedef Day = πŸ› || πŸ–₯

Alex Li AlexV525

🌍
typedef Day = πŸ› || πŸ–₯
View GitHub Profile
@AlexV525
AlexV525 / http_overrides.dart
Created June 8, 2022 14:32
Bypass Let's encrypt root certificates (typically on Android 7.x)
//
// [Author] Alex (https://github.com/AlexV525)
// [Date] 2022/6/8 20:46
//
import 'dart:convert';
import 'dart:io';
class CustomHttpOverrides extends HttpOverrides {
@override
//
// [Author] Alex (https://github.com/AlexV525)
// [Date] 2020/9/15 14:06
//
import 'dart:async';
import 'package:flutter/widgets.dart';
extension SafeSetStateExtension on State {
@AlexV525
AlexV525 / drawer.dart
Last active June 7, 2022 09:29
Drawer in a transparent page route
//
// [Author] Alex (https://github.com/AlexV525)
// [Date] 2022/6/7 16:35
//
import 'package:flutter/material.dart';
/// A wrapped [Drawer] that typically useful when placed in a transparent route.
class CustomDrawer extends StatefulWidget {
const CustomDrawer({
@AlexV525
AlexV525 / lark_signer.dart
Created June 7, 2022 06:46
Signer for Lark webhooks
import 'dart:convert';
import 'package:crypto/crypto.dart';
Map<String, String> sign({
required String key,
DateTime? dateTime,
}) {
dateTime ??= DateTime.now();
final int timestamp = dateTime.millisecondsSinceEpoch ~/ 1000;
@AlexV525
AlexV525 / main.dart
Created April 28, 2022 03:15
None (same as `nil`, but named `None`)
///
/// [Author] Alex (https://github.com/AlexV525)
/// [Date] 2022/04/28 11:12
///
import 'package:flutter/widgets.dart';
const None none = None();
class None extends Widget {
const None({Key? key}) : super(key: key);
@AlexV525
AlexV525 / main.dart
Last active February 22, 2023 02:41
How to set the highest refresh rate on Android in Flutter using `flutter_displaymode`?
///
/// [Author] Alex (https://github.com/AlexV525)
/// [Date] 2022/03/07 23:25
///
import 'dart:async';
import 'dart:io';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
@AlexV525
AlexV525 / main.dart
Created October 22, 2021 10:39
Subtypes filtering from Supertype stream.
///
/// [Author] Alex (https://github.com/AlexV525)
/// [Date] 2021/10/22 18:38
///
import 'dart:async';
import 'package:meta/meta.dart';
void main() {
_initObservers();
@AlexV525
AlexV525 / decorated_sliver.dart
Last active October 14, 2021 06:39
DecoratedSliver
///
/// [Author] Alex (https://github.com/AlexV525)
/// [Date] 2021/10/13 14:36
///
import 'dart:math' as math;
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
@immutable
@AlexV525
AlexV525 / init.gradle
Last active July 17, 2023 02:38
Gradle with Chinese mirrors
// Use https://gist.github.com/AlexV525/5aff2a1621482e11abc8e97d88200ac1 instead.
🌞 Morning 325 commits β–ˆβ–ˆβ–ˆβ–ˆβ–‹β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 22.4%
πŸŒ† Daytime 571 commits β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 39.3%
πŸŒƒ Evening 489 commits β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 33.6%
πŸŒ™ Night 69 commits β–‰β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 4.7%