Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Guixing Bai khsing

🎯
Focusing
View GitHub Profile
@khsing
khsing / parse_chinese_name.py
Created Mar 3, 2020
分析中文名字的姓和名
View parse_chinese_name.py
from typing import Dict
# https://zh.wikipedia.org/wiki/%E6%BC%A2%E5%A7%93%E7%BE%85%E9%A6%AC%E5%AD%97%E6%A8%99%E6%B3%A8
CHINESE_SURNAMES = [
"赵",
"钱",
"孙",
"李",
"周",
"吴",
"郑",
@khsing
khsing / parse_chinese_name.py
Created Mar 3, 2020
分析中文名字的姓和名
View parse_chinese_name.py
from typing import Dict
# https://zh.wikipedia.org/wiki/%E6%BC%A2%E5%A7%93%E7%BE%85%E9%A6%AC%E5%AD%97%E6%A8%99%E6%B3%A8
CHINESE_SURNAMES = [
"赵",
"钱",
"孙",
"李",
"周",
"吴",
"郑",
View geoip_data_path.diff
diff --git a/infra/conf/router.go b/infra/conf/router.go
index b3870e45..56e71930 100644
--- a/infra/conf/router.go
+++ b/infra/conf/router.go
@@ -1,6 +1,8 @@
package conf
import (
+ "os"
+ "path/filepath"
@khsing
khsing / alt-maven-deps.py
Created Mar 28, 2019
add dependency for maven project
View alt-maven-deps.py
#!/usr/bin/env python
from xml.etree import ElementTree as ET
from argparse import ArgumentParser
import os
import sys
ns = "http://maven.apache.org/POM/4.0.0"
ET.register_namespace("", ns)
namespaces = {'pom' : ns}
@khsing
khsing / extract_articles.py
Created Jan 15, 2019
Extract articles from html which downloaded from archive.org
View extract_articles.py
#!/usr/bin/env python
# coding: utf-8
import os
import sys
from datetime import datetime
from bs4 import BeautifulSoup,Tag
def find_all_html(path):
for root, dirs, files in os.walk(path):
@khsing
khsing / convertImeisv2Imei.py
Created May 8, 2017
Convert IMEI-SV to IMEI
View convertImeisv2Imei.py
# -*- coding: utf-8 -*-
# @Author: khsing
# @Date: 2017-05-08 17:52:55
# @Last Modified by: khsing
# @Last Modified time: 2017-05-08 18:38:08
import sys
import hashlib
def checkImeisv(imeisv):
View app_price_history.js
// ==UserScript==
// @name App Store Price History
// @namespace mybeky
// @author mybeky, khsing
// @include https://itunes.apple.com/*
// @description Add price history table in App Store page
// @icon http://cl.ly/FqTY/appshopper.png
// @version 0.1.2
// @connect *
// @grant GM_xmlhttpRequest
@khsing
khsing / region.sql
Last active Sep 9, 2015
中国三级县市的数据,数据来自统计局
View region.sql
# ************************************************************
# Sequel Pro SQL dump
# Version 4096
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: localhost (MySQL 5.6.26)
# Database: test
# Generation Time: 2015-09-09 07:27:55 +0000
@khsing
khsing / clean_es.py
Created Dec 17, 2013
using this script to clean old logstash indices in ElasticSearch
View clean_es.py
#!/usr/bin/env python
import sys
import json
import httplib
class ElasticSearch(object):
def __init__(self, host="localhost:9200"):
super(ElasticSearch, self).__init__()
if ':' in host:
@khsing
khsing / fix_phone_labels.py
Created Dec 11, 2013
被QQ通讯录搞花了通讯录的标签,用该脚本修复一下
View fix_phone_labels.py
#!/usr/bin/python
# coding:utf-8
import sys
from AddressBook import *
from pprint import pprint
MAPPING = {
u'工作传真': kABPhoneWorkFAXLabel,
u'住宅传真': kABPhoneHomeFAXLabel,
You can’t perform that action at this time.