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 / 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 {
@CaiJingLong
CaiJingLong / main.dart
Created July 8, 2020 03:58
秒表example
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
@CaiJingLong
CaiJingLong / build.gradle
Last active July 5, 2020 07:00
中国的gradle配置
import groovy.json.JsonSlurper
buildscript {
ext.kotlin_version = '1.3.72'
def isChina = false
try {
def connection = new URL('https://api.ip.sb/geoip').openConnection()
connection.setRequestMethod('GET')
def reader = new BufferedReader(new InputStreamReader(connection.inputStream))
def text = reader.readLine()
@CaiJingLong
CaiJingLong / main.dart
Last active September 18, 2020 07:48
Multi textfield
// Copyright (c) 2019, the Dart 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 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {