This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MY_DOMAIN = "notion.lxiange.com" | |
const START_PAGE = "https://www.notion.so/Xiang-Li-s-Public-Notion-Page-b4c2b8f6de6743438f5917445b1cb484" | |
const DISQUS_SHORTNAME = "lxiange" | |
addEventListener('fetch', event => { | |
event.respondWith(fetchAndApply(event.request)) | |
}) | |
const corsHeaders = { | |
"Access-Control-Allow-Origin": "*", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Dockerfile for shadowsocks-libev | |
# | |
FROM alpine | |
MAINTAINER kev <noreply@datageek.info> | |
ARG SS_VER=3.1.0 | |
ARG SS_URL=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$SS_VER/shadowsocks-libev-$SS_VER.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const testCenter = ["HEFEI", "BEIJING", "CHONGQING", "FUZHOU", "XIAMEN", "LANZHOU", "GUANGZHOU", "SHENZHEN", "SHIJIAZHUANG", "HARBIN", "KAIFENG", "LUOYANG", "ZHENGZHOU", "WUHAN", "CHANGSHA", "HOHHOT", "NANJING", "NANTONG", "SUZHOU", "TAICANG", "YANGZHOU", "NANCHANG", "CHANGCHUN", "YANJI", "DALIAN", "SHENYANG", "XIAN", "JINAN", "LINYI", "QINGDAO", "WEIFANG", "WEIHAI", "YANTAI", "SHANGHAI", "TAIYUAN", "CHENGDU", "MIANYANG", "TIANJIN", "WULUMUQI", "KUNMING", "HANGZHOU", "NINGBO"] | |
const testDate = ["2018-10-13", "2018-10-14", "2018-10-20", "2018-10-27", "2018-10-28", "2018-11-04", "2018-11-10", "2018-11-11", "2018-11-17", "2018-11-24", "2018-11-25", "2018-12-01", "2018-12-08", "2018-12-15", "2018-12-16"] | |
function fetchAndParse(city, date) { | |
const url = `https://toefl.etest.net.cn/myHome/8647405/testSeat/queryTestSeats?city=${city}&testDay=${date}` | |
let request = new Request(url, { | |
headers: new Headers({ | |
'Content-Type': 'text/plain', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void foo1(int n) { | |
int bar = 0; | |
for (int i = 0; i < n; i++) { | |
bar++; | |
} | |
} | |
void foo2(int n) { | |
int sum = 0; | |
int i = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/sh | |
ret_code=`curl -I -s --connect-timeout 3 www.baidu.com -w %{http_code} | tail -n1` | |
# I love baidu. | |
echo $ret_code | |
if [ "x$ret_code" = "x200" ];then | |
echo 'good' | |
else | |
curl --connect-timeout 3 -d 'username=1111111111&password=1111111111111' p.nju.edu.cn/portal_io/login | |
# replace the username and password with your own account. | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class Shuffle { | |
private Map<Character, int[]> stats; | |
private Character[] orginArr; | |
private int testTimes = 0; | |
public static Random rand = new Random(); | |
public Shuffle(Character[] arr) { | |
orginArr = Arrays.copyOf(arr, arr.length); | |
stats = new TreeMap<>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Random; | |
import java.util.Scanner; | |
import java.util.ArrayList; | |
import java.math.BigInteger; | |
public class IsPrime { | |
public static boolean isPrime1(long num) { | |
if (num <= 1) { | |
return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 100floor.py | |
ans={0:0} | |
def getNum(floors): | |
if len(ans) > floors: | |
return | |
for num in range(1,floors): | |
ans[num]=(min([max(k, ans[num - k] + 1) for k in range(1, num + 1)])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <iostream> | |
class Father { | |
public: | |
int a; | |
Father(){a=233;} | |
Father(int i){a=i;} | |
virtual void show() { |
NewerOlder