Skip to content

Instantly share code, notes, and snippets.

View wilinz's full-sized avatar
🔎
正在上早八

wilinz wilinz

🔎
正在上早八
  • Guilin University of Electronic Technology School of Artificial Intelligence
  • China Guilin
View GitHub Profile
@wilinz
wilinz / calender.md
Created October 26, 2024 19:36 — forked from yulanggong/calender.md
日历标准格式研究

日历标准格式研究

日历的导入导出

格式

现在通用的日历格式是 iCalendar,通常扩展名是 .ics

BEGIN:VCALENDAR #日历开始
@wilinz
wilinz / calculate_adjusted_workday_relationship.dart
Last active June 28, 2024 03:20
计算调休的假日该上哪一天的课
import 'package:dart_extensions/dart_extensions.dart';
import 'package:intl/intl.dart';
import 'package:lunar/lunar.dart';
List<Map<String, String>> calculateAdjustedWorkdayRelationship(
{required List<Holiday> holidays,
required String holidayName,
required int Function(String holidayName) getHolidayLength}) {
final dataTimeFormat = DateFormat("yyyy-MM-dd");
@wilinz
wilinz / IgnoreOKHttpCertificate.kt
Last active April 23, 2024 17:10
OKHttp ignoreCertificate Kotlin
package com.wilinz.xxx.util
import okhttp3.OkHttpClient
import java.security.SecureRandom
import java.security.cert.X509Certificate
import javax.net.ssl.SSLContext
import javax.net.ssl.TrustManager
import javax.net.ssl.X509TrustManager
private fun OkHttpClient.Builder.ignoreCertificate(): OkHttpClient.Builder {
@wilinz
wilinz / OkHttpUtil.java
Created April 23, 2024 17:03 — forked from preethamhegdes/OkHttpUtil.java
OkHttp Client Ignore certificate
import okhttp3.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.net.ssl.*;
import java.net.*;
import java.security.cert.CertificateException;
/*
okhttp version used 3.8.1
@wilinz
wilinz / fluttertoast.dart
Last active March 13, 2024 13:07
fluttertoast 封装
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:get/get.dart';
import 'package:xxx/generated/locales.g.dart';
import 'package:xxx/ui/route.dart';
final FToast fToast = FToast();
bool _isInit = false;
void toast(dynamic message) {
@wilinz
wilinz / Sample.kt
Last active March 3, 2024 15:12
Compose Material3 TimePickerDialog
@Composable
fun Sample() {
val timePickerState =
rememberTimePickerState(
is24Hour = true,
initialHour = 12,
initialMinute = 0
)
var isShowTimePicker by remember {
mutableStateOf(false)
@wilinz
wilinz / ComposeCheckboxWithLabel.kt
Last active February 29, 2024 13:25
ComposeCheckboxWithLabel
package com.wilinz.xxx
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Checkbox
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
@wilinz
wilinz / MoshiExt.kt
Last active May 2, 2024 10:03
MoshiExt.kt
import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.JsonReader
import com.squareup.moshi.JsonWriter
import com.squareup.moshi.Moshi
import okio.BufferedSink
import okio.BufferedSource
inline fun <reified T> Moshi.adapter(): JsonAdapter<T> = adapter(T::class.java)
package com.wilinz.cgsdk.util
@wilinz
wilinz / pointer.go
Last active October 25, 2023 16:16
go pointer util
package ptr
func ptr[T any](v T) *T {
return &v
}
func unptr[T any](ptr *T) T {
return *ptr
}
@wilinz
wilinz / delete_all_wordArt.vba
Last active September 16, 2023 09:03
delete all wordArt
Sub DeleteArtisticText()
Dim oShape As Shape
Dim toDelete As New Collection
Dim targetTexts() As Variant
' Specify the texts you want to delete
targetTexts = Array("Text1", "Text2", "Text3") ' Add your specific texts here
' First, find all shapes to delete and add them to the collection
For Each oShape In ActiveDocument.Shapes