Skip to content

Instantly share code, notes, and snippets.

View kuloud's full-sized avatar
🎯
Focusing

kuloud kuloud

🎯
Focusing
View GitHub Profile
@kuloud
kuloud / docusaurus-css-variables.css
Created May 20, 2025 08:19 — forked from abhigyantrips/docusaurus-css-variables.css
This is a list of all CSS variables for Docusaurus (@docusaurus/preset-classic), which uses Infima (https://infima.dev/) as its styling framework.
/*
Docusaurus CSS Variables.
I'm making this since I wanted to customize my Docusaurus site theme, but couldn't find a proper list of all Infima CSS variables
the static site generator uses. Thus, I basically copied the root of my site's CSS (along with other vars I found), and made a list
of them that categorizes the vars.
TABLE OF CONTENTS:
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
div, p {
@apply text-dark1;
}
[type=checkbox],[type=radio] {
@kuloud
kuloud / resize_convert_images.py
Created March 21, 2024 08:20
图片批处理拓展指定大小并移除白色背景
import os
from PIL import Image
def process_image(input_path, output_path, target_width, target_height):
# 打开图片
image = Image.open(input_path)
# 获取图片原始尺寸
width, height = image.size
@kuloud
kuloud / mailbox.py
Created May 25, 2022 11:48 — forked from cgoldberg/mailbox.py
MailBox class for processing IMAP email (Gmail from Python example)
#!/usr/bin/env python
"""MailBox class for processing IMAP email.
(To use with Gmail: enable IMAP access in your Google account settings)
usage with GMail:
import mailbox
@kuloud
kuloud / lagrange.go
Created November 1, 2016 06:34
不等距拉格朗日插值公式
/**
不等距拉格朗日插值公式
*/
func CalcByLagrange(x []float64, y []float64, t float64) float64 {
// 初值
result := 0.0
// 特例处理
if len(x) <= 1 {
return result
@kuloud
kuloud / double_buffer.go
Created November 1, 2016 05:59
buffer for double
/**
buffer for double
*/
type DoubleBuffer struct {
index int32
buffer []float64
isFull bool
}
public static int ping(String url) {
try {
Process e = Runtime.getRuntime().exec("ping -c 1 -w 20 " + url);
int status = e.waitFor();
return status;
} catch (Exception e) {
// ignore
}
}
@kuloud
kuloud / gist:07847727549486b0e48c
Created June 19, 2014 08:59
Get status bar height
public int getStatusBarHeight(Context context){
Class<?> c = null;
Object obj = null;
Field field = null;
int x = 0, statusBarHeight = 0;
try {
c = Class.forName("com.android.internal.R$dimen");
obj = c.newInstance();
field = c.getField("status_bar_height");
x = Integer.parseInt(field.get(obj).toString());