Skip to content

Instantly share code, notes, and snippets.

View hailiang-wang's full-sized avatar
🌴
On vacation

Hai Liang W. hailiang-wang

🌴
On vacation
View GitHub Profile
@hailiang-wang
hailiang-wang / castodon-cla-v1.md
Created November 19, 2023 23:29
Castodon CLA File

Castodon 个人贡献者许可协议

感谢您对向北京华夏春松科技有限公司或其任何关联方(“华夏春松”)主办或管理的项目贡献软件代码的兴趣。为厘清就个人或实体贡献内容而授予的知识产权许可,华夏春松必须对每位贡献者签署的贡献者许可协议(“CLA”)进行归档,以证明就以下许可条件达成的一致。此版本的贡献者许可协议允许个人向相应项目提交贡献内容。如果您是以公司名义进行提交,您应当另行签署一份公司贡献者许可协议。请完成并签署本协议,然后通过 email 发送一份 pdf 扫描版至 legal@cskefu.com。请在签署之前仔细阅读本文件,并自行保留一份以供参考。

就您目前和将来向华夏春松提交的贡献内容,您接受并同意以下条款和条件。除了根据本协议向华夏春松和华夏春松发布软件的接收方授予的许可,您对于您的贡献内容保留所有权利、所有权和利益。

定义

“您”(或“您的”)系指与华夏春松签署本协议的著作权人或经著作权人授权的法律实体。对于法律实体而言,提交贡献内容的实体以及其他任何控制该实体、受其控制或与其受到同一主体控制的实体被视为单个贡献者。为本定义之目的,“控制” 系指(i)通过合同或其他方式,直接或间接对该实体进行指导和管理的权力,(ii)持有该实体百分之五十(50%)或更多的已发行股份,或(iii)间接持有该实体权益。

@hailiang-wang
hailiang-wang / mmseg_example.py
Created July 19, 2017 18:16
基于MMSEG中文分词算法的 Python3 实现
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#===============================================================================
#
# Copyright 2017 Hai Liang Wang <hailiang.hl.wang@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@hailiang-wang
hailiang-wang / conditionalformatting.py
Created February 21, 2023 03:19 — forked from pythonexcels/conditionalformatting.py
Conditional Formatting in Excel using Python
#
# conditionalformatting.py
# Create two tables and apply Conditional Formatting
#
import win32com.client as win32
excel = win32.gencache.EnsureDispatch('Excel.Application')
#excel.Visible = True
wb = excel.Workbooks.Add()
ws = wb.Worksheets('Sheet1')
ws.Range("B2:K2").Value = [i for i in range(1,11)]
@hailiang-wang
hailiang-wang / generate-ssh-key
Created September 28, 2022 11:52 — forked from hongkongkiwi/generate-ssh-key
Simple one liner to generate an SSH key without a password in the default place with the comment as hostname then print out the public key for copy and paste.
HOSTNAME=`hostname` ssh-keygen -t rsa -C "$HOSTNAME" -f "$HOME/.ssh/id_rsa" -P "" && cat ~/.ssh/id_rsa.pub
@hailiang-wang
hailiang-wang / pkl_to_json.py
Created April 20, 2017 02:12
Convert python pickle file to json
#!/usr/local/bin/python3
'''
Convert a pkl file into json file
'''
import sys
import os
import _pickle as pickle
import json
@hailiang-wang
hailiang-wang / gcash2ledger.py
Created December 27, 2021 04:10 — forked from nonducor/gcash2ledger.py
A simple script to convert an (uncompressed) gnucash XML file to the ledger-cli format
#! /usr/bin/python3
import os
import sys
import dateutil.parser
import xml.etree.ElementTree
nss = {'gnc': 'http://www.gnucash.org/XML/gnc',
'act': 'http://www.gnucash.org/XML/act',
'book': 'http://www.gnucash.org/XML/book',
; Recommended for performance and compatibility with future AutoHotkey releases.
#NoEnv
; Recommended for catching common errors.
#Warn
; There's no reason to run this script more than once
#SingleInstance force
;; memo hotkey shortcuts
@hailiang-wang
hailiang-wang / fork forced sync
Created October 5, 2021 01:33 — forked from glennblock/fork forced sync
Force your forked repo to be the same as upstream.
git fetch upstream
git reset --hard upstream/master
@hailiang-wang
hailiang-wang / emulator-install-using-avdmanager.md
Created October 1, 2021 09:21 — forked from mrk-han/emulator-install-using-avdmanager.md
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For generic skin emulator with default apis (without google apis):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-29;default;x86"

@hailiang-wang
hailiang-wang / kyteapos2en.pl
Created July 1, 2021 06:12 — forked from neubig/kyteapos2en.pl
A program to change KyTea's Japanese POS tags to english tags
#!/usr/bin/perl
# This is a script to change KyTea's POS tags in Japanese to English
# abbreviations
use strict;
use utf8;
use Getopt::Long;
use List::Util qw(sum min max shuffle);
binmode STDIN, ":utf8";
binmode STDOUT, ":utf8";