Skip to content

Instantly share code, notes, and snippets.

Avatar

PAN, Myautsai mckelvin

View GitHub Profile
@mckelvin
mckelvin / accounting-ch3.beancount
Last active Apr 11, 2021
使用 beancount 表示肖星《财务分析与决策课程》 第三章中提及的例子
View accounting-ch3.beancount
; 肖星 - 《财务分析与决策课程》
; <https://open.163.com/newview/movie/free?pid=MDPKDHH4O&mid=MDR7K8231>
; 3.1企业设立、筹建中的经济活动与财务报表
; ~
; 3.6所得税、利润、利润分配与财务报表
option "title" "模拟公司"
option "operating_currency" "CNY"
View fretboard.md
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
View bwg-migrate.py
# BWG_VE_ID=<TODO>
# BWG_API_KEY=<TODO>
# */10 * * * * /usr/bin/python3 /usr/local/bin/bwg-migrate.py >> /var/log/bwg-migrate.log 2>&1
import os
import random
import logging
import requests
View a.beancount
pushtag #coffee-2020
2020-01-01 * "预付未来1年的咖啡"
Assets:Saving:CN:CMB -12*4*30 CNY
Income:Wool:CoffeeShopX -200 CNY
Assets:PrePayments:CoffeeShopX
2020-01-01 # "每周一杯咖啡 [WEEKLY UNTIL 2020-12-01]"
Expenses:Food:Coffee 30 CNY
Assets:PrePayments:CoffeeShopX
poptag #coffee-2020
View xueqiu-no-nav.js
// ==UserScript==
// @name No fixed nav in xueqiu.com
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://xueqiu.com/*
// @grant GM_addStyle
// ==/UserScript==
View flask_echo.py
#!/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 """
View MACD explained in math.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mckelvin
mckelvin / Makefile
Created Jan 30, 2019
Generate self-signed certs for mitmproxy on macOS
View Makefile
# Generate self-signed certificates for mitmproxy:
# mitmproxy-ca.pem
# mitmproxy-ca-cert.pem
# mitmproxy-dhparam.pem
#
# Usage:
# Put this make file in ~/.mitmproxy/Makfile and run make
all: mitmproxy-dhparam.pem mitmproxy-ca.pem mitmproxy-ca-cert.pem
@mckelvin
mckelvin / flushdns
Last active Feb 19, 2020 — forked from thewellington/flushdns
Flush DNS in OS X / macOS
View flushdns
#!/bin/bash
#
# flushdns
# This script will flush your DNS cache on Mac OS X 10.4 - 10.15.
# The method for doing this chages it seems in every version of OS X,
# and I can never remember the correct command, so I wrote this script
# and gave it a name I could remeber.
#
# v.2016-02-01 by bill@wellingtonnet.net
View pm250_air352_collector.py
"""
352 Air PM2.5 采集仪指标采集
"""
import time
import struct
import socket
UDP_IP = "0.0.0.0"
UDP_PORT = 11530