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 / config.json
Last active September 18, 2024 02:37
一个转化订阅的 dart 服务器,处理 clash 的 json,添加规则/节点
{
"port": 3300,
"meta": "https://example.com/api/v1/client/subscribe?token=REDACTED&flag=clash",
"ssr-meta": "https://example.com?clash=1",
"nodes": [
{
"name": "my-home",
"schema": "hysteria2",
"host": "REDACTED",
"port": 34443,
@CaiJingLong
CaiJingLong / show_so_flutter_package.dart
Created July 4, 2024 03:55
Show the package for libapp.so
import 'dart:io';
void main(List<String> args) {
final file = File('/Users/cai/Downloads/base.apk/lib/arm64-v8a/libapp.so');
final content = file.readAsBytesSync();
// convert to ascii
final text = content.map((e) => String.fromCharCode(e)).join();
@CaiJingLong
CaiJingLong / pinyin_utils.dart
Created April 29, 2024 08:37
拼音模糊匹配的方法,需要导入 pinyin 库 flutter pub add pinyin
import 'package:flutter/material.dart';
import 'package:pinyin/pinyin.dart';
class PinyinCompareResult {
final bool isMatch;
final String pinyin;
final Map<int, bool> matchIndex;
PinyinCompareResult({
required this.isMatch,
@CaiJingLong
CaiJingLong / init.gradle.kts
Last active November 22, 2023 03:48 — forked from bennyhuo/init.gradle.kts
Copy files to ~/.gradle, then change to your maven proxy url.
// Thanks to: https://gist.github.com/bennyhuo/af7c43cc4831661193605e124f539942
println("The init script init.gradle.kts is running!")
val gradleHome = System.getProperty("user.home") + "/.gradle"
apply {
val gradleVersion = gradle.gradleVersion
if (gradleVersion < "6.8") {
from(gradleHome + "/old.gradle.kts")
} else {
@CaiJingLong
CaiJingLong / add-dep.sh
Last active August 11, 2023 02:50
For umi + antd5 i18n
# Add dayjs dep first
pnpm add dayjs
@CaiJingLong
CaiJingLong / init.gradle.kts
Last active July 31, 2023 02:08 — forked from AlexV525/init.gradle.kts
Mirroring Gradle repositories
// Thanks to: https://gist.github.com/bennyhuo/af7c43cc4831661193605e124f539942
val localMavenUrl = "http://localhost:8081/repository/maven-public/"
val urlMappings = mapOf(
"https://dl.google.com/dl/android/maven2" to localMavenUrl,
"https://repo.maven.apache.org/maven2" to localMavenUrl,
"https://plugins.gradle.org/m2" to localMavenUrl,
)
@CaiJingLong
CaiJingLong / main.dart
Created January 3, 2023 04:00
vagrant-oak-1842
// 转换数字为中文大写
// 比如:123456789.12 转换为 壹亿贰仟叁佰肆拾伍万陆仟柒佰捌拾玖元壹角贰分
String convertNumberToChinese(double number) {
final numberText = number.toStringAsFixed(2);
final numberTextList = numberText.split('.');
final integerText = numberTextList[0];
final decimalText = numberTextList[1];
final integerTextList = integerText.split('');
final decimalTextList = decimalText.split('');
@CaiJingLong
CaiJingLong / GetFileSize.go
Created August 14, 2020 01:32
Get file size with goland
package main
import (
"fmt"
"io/ioutil"
"os"
)
func main() {
if len(os.Args) <= 1 {