Skip to content

Instantly share code, notes, and snippets.

View chawyehsu's full-sized avatar
☯️
no silver bullet

Chawye Hsu chawyehsu

☯️
no silver bullet
View GitHub Profile
@chawyehsu
chawyehsu / CleanSubtitleFile.py
Last active July 28, 2018 06:22
自用小脚本:对从ch9下载的字幕文件进行自动化整理,去除无用行方便导入Aegisub
import os, glob
keys = [
"WEBVTT",
"-->"
]
def hasKey(array, line):
for item in array:
if item in line:
@chawyehsu
chawyehsu / fapi.php
Last active August 29, 2015 14:08
[API] Get favcion of a site.
<?php
$url = @$_GET['url'];
if($url) {
$url = preg_replace('/http\:\/\//i', '', $url);
$url = 'http://' . $url;
$domain = parse_url($url);
$url = $domain['host'];
$dir = 'fcache';
$dfav = $dir . "/default.ico";
$fav = $dir . "/" . $url . ".ico";
@chawyehsu
chawyehsu / messages.yml
Created December 22, 2014 09:05
Simplified Chinese translation of "SimpleAuth", a plugin of PocketMine-MP, the Minecraft PE server software.
# SimpleAuth 1.4.0 language file
join:
message: "本服使用了SimpleAuth进行身份验证。"
register: "您尚未注册。\n注册指令: /register <password>"
login: "登录指令: /login <password>"
register:
usage: "/register <password>"
description: "注册指令"
@chawyehsu
chawyehsu / zh_CN.yml
Last active August 29, 2015 14:20
[Version 1.3]: Simplified Chinese translation of "UHPlugin" (https://github.com/AmauryCarrade/UHPlugin), a plugin for Minecraft server, creating uhc game.
author: "h404bi"
keys:
load:
spawnPointAdded: "预设出生点 {0},{1} 已从配置文件载入"
invalidSpawnPoint: "配置文件预设的出生点无效: {0}"
teamAdded: "预设队伍 {0} 已从配置文件载入"
namedTeamAdded: "预设队伍 {0} ({1}) 已从配置文件加入"
invalidTeam: "配置文件预设的队伍无效: {0}"
recipeApple: "已增加新的金苹果合成配方"
recipeCompass: "已增加新的指南针合成配方"
@chawyehsu
chawyehsu / VeinMiner_zh_CN.lang
Last active August 22, 2016 08:38
⚠️ 该版本已过时,前往 https://goo.gl/vTS24U 获取最新翻译文件。- Simplified Chinese translation of "VeinMiner" mod.
# Command usage/error
command.veinminer=/veinminer mode/blocklist/toollist/blocklimit/radius/per_tick/saveconfig/help
command.veinminer.enable=/veinminer mode auto/sneak/no_sneak
command.veinminer.blocklist=/veinminer blocklist %s add/remove <模组 id>:<方块名> <metadata>
command.veinminer.toollist=/veinminer toollist %s add/remove <工具 id>
# Command result/Mode status
command.veinminer.set.disable=已禁用 Veinminer
command.veinminer.set.auto=已设置 Veinminer 为热键模式
command.veinminer.set.sneak=已设置 Veinminer 为潜行模式
@chawyehsu
chawyehsu / hook.py
Created September 24, 2015 06:04
GitHub pages Webhook
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
# start a python service and watch the nginx request dog
from http.server import HTTPServer, CGIHTTPRequestHandler
from threading import Thread, RLock
from hashlib import sha1
import ipaddress
import subprocess
import requests
From: Wesley Wolfe <email redacted>
Date: 3 September 2014 03:48
Subject: [SL] [abuse-google] Copyright
My name is Wesley Wolfe. A site hosted on an IP address owned by Multiplay
(ip redacted) is infringing on my software copyright by the distribution
of a software known as CraftBukkit.
Original content can be found at
@chawyehsu
chawyehsu / configuration.xml
Last active March 25, 2023 03:43
Office 2016 CUSTOM INSTALLATION configuration, to only install Word, Excel, PowerPoint and Outlook. Office 2016 自定义安装. https://chawyehsu.com/blog/2018/03/office-2016-custom-installation-guide
<!-- Office 365 client configuration file sample. To be used for Office 365 ProPlus 2016 apps,
Office 365 Business 2016 apps, Project Pro for Office 365 and Visio Pro for Office 365.
For detailed information regarding configuration options visit: http://aka.ms/ODT.
To use the configuration file be sure to remove the comments
For Office 365 client apps (verion 2013) you will need to use the 2013 version of the
Office Deployment Tool which can be downloaded from http://aka.ms/ODT2013
The following sample allows you to download and install Office 365 ProPlus 2016 apps
@chawyehsu
chawyehsu / index.html
Created August 20, 2017 15:59
思源字体网页 font-family 指定 test case(仅简中)
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>思源字体网页 font-family 指定 test case(仅简中)</title>
<style>
body {
font-family: simsun,serif;
font-weight: normal;
}
@chawyehsu
chawyehsu / soft-line-breaks-reference.txt
Last active July 15, 2018 09:34
About CJK soft-line-breaks
https://talk.commonmark.org/t/soft-line-breaks-should-not-introduce-spaces/285
https://github.com/markdown-it/markdown-it/issues/334
http://chenyufei.info/blog/2011-12-23/fix-chinese-newline-becomes-space-in-browser-problem/
https://stackoverflow.com/questions/8550112/prevent-browser-converting-n-between-lines-into-space-for-chinese-characters/8551033#8551033
http://blog.guorongfei.com/2015/04/25/how-to-fix-the-markdown-newline-blank-problem/
https://9.obelus.net/2018/04/15/cjk-markdown-whitespace-and-newline.html
https://www.v2ex.com/t/69433