Skip to content

Instantly share code, notes, and snippets.

View iydon's full-sized avatar
📚
Focusing

Iydon Liang iydon

📚
Focusing
View GitHub Profile
@iydon
iydon / texfind.py
Last active April 18, 2022 08:45
查找 TeX 发行版中各宏包与文类的命令、环境等信息
__all__ = ['TeXParser', 'TeXDistribution']
__version__ = '0.1.0'
import collections as c
import json
import pathlib as p
import re
import textwrap
import typing as t
'''
🔵⬜🟦⬜🟦
⬜⬜🟦⬜🟦
🟦⬜🟦🟦🟦
🟦⬜⬜⬜🟦
🟦⬜🟦🟦🟦
'''
import random
@iydon
iydon / dfyl.py
Created February 15, 2022 05:43
年代已久的电费余量查询
import datetime
import requests
from bs4 import BeautifulSoup
class SUSTech:
_url_login = 'https://cas.sustech.edu.cn/cas/login'
def __init__(self, username, password):
@iydon
iydon / tis.py
Last active September 16, 2023 18:08
查询 SUSTech 2021 级研究生 GPA
__import__('warnings').filterwarnings('ignore')
import functools as f
import re
import typing as t
import bs4
import pandas as pd
import requests
@iydon
iydon / top50.md
Created December 29, 2021 12:23
2018 年爬虫光顾 Top 50 公司排行榜
序号 公司 域名 流量占比
1 中国铁路客户服务中心 12306.cn 18.65%
2 微博 weibo.cn 18.05%
3 淘宝 taobao.com 12.16%
4 百度 baidu.com 6.22%
5 大众点评 dianping.com 6.14%
6 联通 10010.com 4.82%
7 微信搜索 weixin.sogou.com 2.85%
8 最高人民法院公告查询 court.gov.cn 2.78%
@iydon
iydon / score_adjustment.py
Last active December 14, 2021 03:27
指数型分数调整
import typing as t
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import streamlit as st
class get:
import collections
import os
import pathlib
import typing as t
import pygame
import pygame.gfxdraw
import numpy as np
@iydon
iydon / lib.rs
Created November 29, 2021 09:17
use Python indentation in Rust by macro
#![feature(proc_macro_span)]
extern crate proc_macro;
use proc_macro::TokenStream;
use std::cmp::Ordering::{Greater, Less, Equal};
#[proc_macro]
pub fn python(tokens: TokenStream) -> TokenStream {
let mut lines: Vec<String> = source_code(tokens)
@iydon
iydon / ctex-fontset-sustech.def
Created October 18, 2021 14:03
配置 sharelatex.cra.moe 字体(不知道具体字体名称,所以抑制了 `no-script "CJK"` 警告)
% https://sikouhjw.gitee.io/2021/02/14/2021-02-14-fontset-overleaf/
% https://www.overleaf.com/latex/templates/using-the-ctex-package-on-overleaf-zai-overleafping-tai-shang-shi-yong-ctex/gndvpvsmjcqx
% https://zhuanlan.zhihu.com/p/145429470
\GetIdInfo$Id: ctex.dtx 81d4c90 2020-10-19 20:24:58 +0800 Qing Lee <[email protected]> $
{SUSTech fonts definition (CTEX)}
\ProvidesExplFile{ctex-fontset-sustech.def}
{\ExplFileDate}{2.5.5}{\ExplFileDescription}
\RequirePackage{xpatch}
\xpatchcmd \fontspec_new_script:nn
{ \__fontspec_warning:nxx }
@iydon
iydon / snapshot.py
Last active October 12, 2021 06:28
PDF快照,解决渲染慢的问题
import fitz
import os
import pathlib
import pdf2image
import shutil
import subprocess
import tempfile
from typing import Callable, Iterator, List, Union