Skip to content

Instantly share code, notes, and snippets.

View skyzh's full-sized avatar
🐱
working

Alex Chi Z. skyzh

🐱
working
View GitHub Profile
@skyzh
skyzh / main.py
Last active July 28, 2017 14:39
Mock Transaction: N people have `DEFALUT_WALLET` CNY at the beginning, and will transfer 1 CNY to another person in each round. After R rounds, this program will print how much money each person has.
#!/usr/bin/env python3
import random
DEFAULT_WALLET = 100
N = 100
R = 100
def do_transaction(storage, id_from, id_to):
storage[id_from] -= 1
@skyzh
skyzh / index.js
Created June 16, 2017 12:11
This script will parse Data under College English Disc to a html containing all answers.
const _ = require('lodash');
const Promise = require('bluebird');
const parser = Promise.promisifyAll(new require('xml2js').Parser());
const fs = Promise.promisifyAll(require('fs'));
let output = "";
fs.readdirAsync(`${__dirname}/data`)
.filter(file => /^1U0[6-7]p[A-Z0-9]{2}[A-F].xml$/.test(file))
.map(file => {
@skyzh
skyzh / chnroute.conf
Created February 25, 2017 04:34
surge chnroute config
# Shadowrocket: 2017-02-25 12:29:14
[General]
bypass-system = true
skip-proxy = 192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,localhost,*.local,e.crashlynatics.com,captive.apple.com
bypass-tun = 10.0.0.0/8,100.64.0.0/10,127.0.0.0/8,169.254.0.0/16,172.16.0.0/12,192.0.0.0/24,192.0.2.0/24,192.88.99.0/24,192.168.0.0/16,198.18.0.0/15,198.51.100.0/24,203.0.113.0/24,224.0.0.0/4,255.255.255.255/32
dns-server =
[Rule]
DOMAIN-KEYWORD,google,PROXY,force-remote-dns
@skyzh
skyzh / direct.conf
Created February 25, 2017 04:33
surge default config for direct
[General]
bypass-system = true
skip-proxy = 192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,localhost,*.local,e.crashlynatics.com,captive.apple.com
bypass-tun = 10.0.0.0/8,100.64.0.0/10,127.0.0.0/8,169.254.0.0/16,172.16.0.0/12,192.0.0.0/24,192.0.2.0/24,192.88.99.0/24,192.168.0.0/16,198.18.0.0/15,198.51.100.0/24,203.0.113.0/24,224.0.0.0/4,255.255.255.255/32
dns-server =
[Rule]
FINAL,DIRECT

论如何在网站上发布新闻

  1. 首先你需要一个 GitHub 账号。 https://github.com。
  2. 访问 https://github.com/frcefz/website/ ,点击 Fork 把这个项目拷贝到自己的账户下。
  3. 在拷贝后的网站 _posts 文件夹下点击 Create New File 创建文件。
  4. 文件名设置为 2016-08-04-first-day-training.markdown (格式为 日期-英文名(无空格))。
  5. 复制文件头
    ---
    layout: post
    
@skyzh
skyzh / README.md
Last active July 6, 2016 10:10
FRC@EFZ Programming Training

编写下列朴素机器人控制程序

  1. 底盘向前开两秒,停两秒,再向前开两秒,停止。
    • 提示:
      • 创建 Simple Robot
      • 使用 RobotDrive
      • 前左,前右,后左,后右马达分别对应端口 1, 2, 3, 4
      • 注意了,我们使用的马达控制器是 VictorSP
      • 延时可以使用 Timer.delay(...)
  • 全部编写在自动控制函数内

Keybase proof

I hereby claim:

  • I am skyzh on github.
  • I am skyzh (https://keybase.io/skyzh) on keybase.
  • I have a public key whose fingerprint is 2894 A8BA 99EB 1686 9CD0 005A F14F 523A D023 B56C

To claim this, I am signing this object:

@skyzh
skyzh / space.cpp
Created September 17, 2015 11:11
Read Space in string
for(int i = 0, j; i < str.length(); i = j + 1) {
for(j = i; j != ' ' && j < str.length(); ++j) {
}
}
@skyzh
skyzh / ums - Database.md
Last active August 29, 2015 14:27
ums Database

μms Database

  • TABLE User
  • TABLE UserProfile
  • TABLE UserLog
  • TABLE Session
  • TABLE CAPTCHA
  • TABLE MailQueue
  • TABLE DirectMessage
  • TABLE Application
@skyzh
skyzh / CloudOJ - Database.md
Last active August 29, 2015 14:27
CloudOJ v2 Database

User

  • TABLE User
  • TABLE UserProfile
  • TABLE Userlevel
  • TABLE Admingroup

Problem

  • TABLE Problem