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
@AlexV525
AlexV525 / init.gradle.kts
Last active February 21, 2024 18:42
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,