Skip to content

Instantly share code, notes, and snippets.

View duskmoon314's full-sized avatar

Campbell He duskmoon314

View GitHub Profile
@duskmoon314
duskmoon314 / ctex-fontset-founderfree.def
Last active March 14, 2023 14:45
ctex fontset founderfree: Only use total free founder fonts in ctex
\ProvidesExplFile{ctex-fontset-founderfree.def}
{\ExplFileDate}{2.5.5}{\ExplFileDescription}
\ctex_fontset_case:nnn
{
% TODO: Set font for pdfTeX
}
{
% TODO: Set font for upTeX
}
{
@duskmoon314
duskmoon314 / log_helper.h
Last active February 23, 2022 09:06
C log macro with color and level
#define ERROR 0
#define WARN 1
#define INFO 2
#define DEBUG 3
#define TRACE 4
static int LOG_LEVEL = 2;
static int LOG_COLOR = 0;
#define HELPER_LOG stdout
@duskmoon314
duskmoon314 / proxy.sh
Last active March 17, 2023 16:01
a shell script to set proxy in wsl2 and Linux / MacOS
#!/bin/sh
if [ $(uname -r | sed -n 's/.*\( *Microsoft *\).*/\1/ip') ]; then
hostip=${host:=$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }')}
else
hostip=${host:-127.0.0.1}
fi
port_http=${port_http:-10809}
port_sock=${port_sock:-10808}