Skip to content

Instantly share code, notes, and snippets.

View mckelvin's full-sized avatar

GitHubLeakedPAN, GitHubLeakedMyautsai mckelvin

View GitHub Profile
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! xeCJK error: "key-unknown"
!
! Sorry, but xeCJK/options does not have a key called 'CJKtextspaces'.
!
! The key 'CJKtextspaces' is being ignored.
!
! See the xeCJK documentation for further information.
!
@mckelvin
mckelvin / remove_jietumacapp.sh
Last active October 25, 2022 03:11 — forked from ITJesse/remove_jietumacapp
删除 QQ for Mac 的流氓截图
#!/bin/sh
chmod 0000 "/Applications/QQ.app/Contents/Library/LoginItems/QQ jietu plugin.app/Contents/MacOS/QQ jietu plugin"
#!/bin/sh
ag -0 -l $1 | xargs -0 perl -pi -e "s/$1/$2/g"
@mckelvin
mckelvin / sshfs_usage.md
Created August 9, 2012 04:01
usage of `sshfs`

refer

## init
$ sudo mkdir /mount_point_absolute_path
$ sudo chown local_user /mount_point_absolute_path

## before
$ sshfs remote@remote_hostname:remote_absolute_path /mount_point_absolute_path
@mckelvin
mckelvin / accounting-ch3.beancount
Last active April 11, 2021 09:02
使用 beancount 表示肖星《财务分析与决策课程》 第三章中提及的例子
; 肖星 - 《财务分析与决策课程》
; <https://open.163.com/newview/movie/free?pid=MDPKDHH4O&mid=MDR7K8231>
; 3.1企业设立、筹建中的经济活动与财务报表
; ~
; 3.6所得税、利润、利润分配与财务报表
option "title" "模拟公司"
option "operating_currency" "CNY"
# coding: utf-8
# code snippet from http://www.johnvinyard.com/blog/?p=268
import numpy as np
from numpy.lib.stride_tricks import as_strided as ast
def norm_shape(shape):
'''
Normalize numpy array shapes so they're always expressed as a tuple,
even for one-dimensional shapes.
Open 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
E F F#/Gb G G#/Ab A A#/Bb B C C#/Db D D#/Eb E F F#/Gb G G#/Ab A A#/Bb B C C#/Db D D#/Eb E
B C C#/Db D D#/Eb E F F#/Gb G G#/Ab A A#/Bb B C C#/Db D D#/Eb E F F#/Gb G G#/Ab A A#/Bb B
G G#/Ab A A#/Bb B C C#/Db D D#/Eb E F F#/Gb G G#/Ab A A#/Bb B C C#/Db D D#/Eb E F F#/Gb G
D D#/Eb E F F#/Gb G G#/Ab A A#/Bb B C C#/Db D D#/Eb E F
@mckelvin
mckelvin / google_beijing.hosts
Created October 23, 2012 08:57
alive hosts in [203.208.44.1, 203.208.49.254]
# *.google.com 笛卡尔集
203.208.45.193
203.208.45.195
203.208.45.196
203.208.45.200
203.208.45.192
203.208.45.201
203.208.45.202
203.208.45.197
203.208.45.203
@mckelvin
mckelvin / surge.conf
Created February 14, 2016 05:50
Rules for Surge with chnroutes
[Rule]
DOMAIN-KEYWORD,google,Proxy,force-remote-dns
DOMAIN-KEYWORD,facebook,Proxy,force-remote-dns
DOMAIN-KEYWORD,youtube,Proxy,force-remote-dns
DOMAIN-KEYWORD,twitter,Proxy,force-remote-dns
DOMAIN-KEYWORD,instagram,Proxy,force-remote-dns
DOMAIN-KEYWORD,gmail,Proxy,force-remote-dns
DOMAIN-KEYWORD,blogspot,Proxy
DOMAIN-SUFFIX,twimg.com,Proxy,force-remote-dns
DOMAIN-SUFFIX,ls.apple.com,DIRECT
#!/usr/bin/env python3
import os
from flask import Flask, request, redirect, url_for
from werkzeug.utils import secure_filename
app = Flask(__name__)
@app.route('/')
def home():
return """