Skip to content

Instantly share code, notes, and snippets.

@liuxilu
liuxilu / 中文记数.cs
Last active October 25, 2020 11:16
千字文 百家姓 韵目代日 生肖 天干 原始天干 地支 地支农历月 原始地支 星宿 星禽 六十甲子 太岁星君 纳音表 北斗七星 北斗七星君 北斗九星 北斗九星君
#pragma warning disable CS1591 // XML 注释
using System.Linq;
using System.Text;
namespace System.Globalization.Chinese {
public static class 算数 {
public static decimal ToNum<T>(string s) where T : Enum {
Type enumType = typeof(T);
double numBase = ((int[])Enum.GetValues(enumType)).Distinct().Count();
@liuxilu
liuxilu / PoolmonRegex.txt
Created June 19, 2020 11:10
regex for poolmon to table
^ *(\S+) +(Nonp|Paged) +(-?\d+) +\( *(-?\d+)\) +(-?\d+) +\( *(-?\d+)\) +(-?\d+) +(-?\d+) +\( *(-?\d+)\) +(-?\d+)
\1\t\2\t\3\t\4\t\5\t\6\t\7\t\8\t\9\t$10
@liuxilu
liuxilu / DualLangMSdoc.js
Last active June 14, 2020 02:03
bilingual (two-language) microsoft document. 双语对照 微软 文档
//select the switch on the top-right page to show english first.
if(document.querySelector("#language-toggle")!=undefined){
document.querySelectorAll("span[style='display: inline;']").forEach(a=>{a.innerHTML='<sup>'+a.innerHTML+'</sup><br>';});
document.querySelectorAll("span[style='display: none;']").forEach(a=>{a.style='display:inline';a.innerHTML=a.innerHTML+'<br>';}); }