Skip to content

Instantly share code, notes, and snippets.

View langningchen's full-sized avatar
🏫
Preparing for the college entrance exam

Langning Chen langningchen

🏫
Preparing for the college entrance exam
View GitHub Profile
import os
import subprocess
from datetime import datetime, timedelta
# ================= 配置区域 =================
TARGET_YEAR = 2020
VISUAL_TEXT = "One China"
# 核心:使用各国原生语言的文件名
#include <algorithm>
#include <string>
#include <vector>
#include <windows.h>
HWND g_enhancedWindowHwnd = NULL;
LONG g_originalExStyle = 0;
BYTE g_originalOpacity = 255;
std::string GetWindowTitle(HWND hwnd)
#!/usr/bin/env fish
# ===== 配置区域 =====
# 测试配置
set TEST_ROUNDS 1000 # 每个题目运行的测试次数
# 编译配置
set COMPILE_FLAGS "-std=c++17" "-O2" "-Wall" "-Wextra" # 编译选项
set COMPILE_TIMEOUT 30 # 编译超时时间(秒)
set ENABLE_DEBUG_INFO false # 是否启用调试信息 (-g)
@langningchen
langningchen / 立体几何常用定理.md
Created June 9, 2025 00:38
立体几何常用定理
  1. 公理及其推论
    • 公理 1:直线上两点在平面上,则该直线所有点在此平面上。
    • 公理 2:非共线三点确定一平面。
    • 推论 1:直线与直线外一点确定一平面。
    • 推论 2:两相交直线确定一平面。
    • 推论 3:两平行直线确定一平面。
    • 公理 3:两不同平面有一公共点,则有且仅有一条过该点的公共直线。
    • 公理 4:平行于同一直线的两直线互相平行。
  2. 直线与直线位置关系
  3. 位置关系:相交、平行、异面。
@langningchen
langningchen / EtextbookDownloader.user.js
Last active April 27, 2025 05:04
Generate and download e-textbook in the format of PDF with object-oriented design
// ==UserScript==
// @name E-textbook Downloader
// @namespace https://github.com/langningchen
// @version 0.0.2
// @description Generate and download e-textbook in the format of PDF with object-oriented design
// @author langningchen
// @match https://sh.etextbook.cn/*
// @grant GM_xmlhttpRequest
// @icon https://sh.etextbook.cn/img/icons/favicon-32x32.png
// @require https://cdnjs.cloudflare.com/ajax/libs/jspdf/3.0.1/jspdf.umd.min.js
@langningchen
langningchen / NBCrack.user.js
Last active March 26, 2025 13:15
Crack NB Chemical and NB Physics virtual experiment
// ==UserScript==
// @name NB Crack
// @namespace https://github.com/langningchen
// @version 0.0.1
// @description Crack NB Chemical and NB Physics virtual experiment
// @author langningchen
// @match https://hx.nobook.com/*
// @match https://wl.nobook.com/*
// @icon https://www.nobook.com/favicon.ico
// @grant none
@langningchen
langningchen / miHoYo.bat
Created February 26, 2025 05:27
A simple script to unblock the LAN blocked miHoYo domain
@echo off
net session >nul 2>&1
if %errorLevel% neq 0 (
powershell start -verb runas '%0' %*
exit /b
)
python "%~dp0miHoYo.py"
pause
@langningchen
langningchen / 三角函数常用公式.tex
Last active March 3, 2025 12:38
三角函数常用公式
\begin{align*}
& \Large\textbf{三角函数常用公式} \\
\\
& \normalsize \begin{aligned}
& 1^\circ = \frac{\pi}{180} \text{rad} \quad
1\text{rad} = \frac{180^\circ}{\pi}
& \textbf{弧度制} \\
& l = ar \quad
S = \frac{1}{2}ar^2
& \textbf{扇形的弧长与面积} \\
@langningchen
langningchen / Info.cpp
Last active November 1, 2024 04:43
About the OJ
#include <bits/stdc++.h>
#include <unistd.h>
#include <dirent.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
using namespace std;
void catFile(const char *path)
{
@langningchen
langningchen / totp.tsx
Created June 28, 2024 13:08
TOTP server based on Cloudflare Workers
// modify line 8~9 and 28
import React from "react";
import { renderToString } from "react-dom/server";
import totpGenerator from "totp-generator";
export default {
async fetch(RequestData: Request, env, ctx) {
const Accounts = {
"account name": "account totp token",
...
};