Skip to content

Instantly share code, notes, and snippets.

View CaiJingLong's full-sized avatar
💭
I may be slow to respond.

Caijinglong CaiJingLong

💭
I may be slow to respond.
View GitHub Profile
@CaiJingLong
CaiJingLong / pinyin_utils.dart
Last active December 20, 2024 02:26
拼音模糊匹配的方法,需要导入 pinyin 库 flutter pub add pinyin
import 'package:flutter/material.dart';
import 'package:pinyin/pinyin.dart';
/// 拼音比较结果类
///
/// 用于存储拼音匹配的结果信息,包括是否匹配、拼音字符串和匹配位置信息
///
/// 主要功能:
/// 1. 存储匹配结果
/// 2. 提供构建富文本的方法,可以高亮显示匹配的字符
@AlexV525
AlexV525 / init.gradle.kts
Last active April 7, 2025 14:03
Mirroring Gradle repositories
// Thanks to: https://gist.github.com/bennyhuo/af7c43cc4831661193605e124f539942
val urlMappings = mapOf(
"https://dl.google.com/dl/android/maven2" to "https://mirrors.tencent.com/nexus/repository/maven-public/",
"https://repo.maven.apache.org/maven2" to "https://mirrors.tencent.com/nexus/repository/maven-public/",
"https://plugins.gradle.org/m2" to "https://mirrors.tencent.com/nexus/repository/gradle-plugins/"
)
fun RepositoryHandler.mirroring() {
all {
@AlexV525
AlexV525 / main.dart
Created September 14, 2020 08:40
How do you make timeline without Intrinsic?
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
@zmtzawqlp
zmtzawqlp / MySliverAppBar.dart
Last active January 13, 2021 09:40
自定义SliverAppbar
import 'package:flutter/material.dart';
typedef OnMySliverAppBarScroll = void Function(double shrinkOffset);
///Sliver App bar
class MySliverAppBar extends StatefulWidget {
final Color backgroundColor;
final double expandedHeight;
@ka010
ka010 / gist:235253db3fccfac53910
Last active March 5, 2020 04:39
Convert an AVFrame to CVPixelbuffer
-(void)getPixelBuffer:(CVPixelBufferRef *)pbuf {
@synchronized (self) {
if(!_pFrame || !_pFrame->data[0])
return;
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
// [NSNumber numberWithBool:YES], kCVPixelBufferCGImageCompatibilityKey,
// [NSNumber numberWithBool:YES], kCVPixelBufferCGBitmapContextCompatibilityKey,
@(_pFrame->linesize[0]), kCVPixelBufferBytesPerRowAlignmentKey,