View main.go
This file contains 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
package main | |
// Refer to: | |
// https://github.com/golang/oauth2/pull/356/files/7cf8880eb1e002ce6fb90ffadae90b41452462e3 | |
// https://docs.github.com/cn/developers/apps/building-oauth-apps/authorizing-oauth-apps#device-flow | |
import ( | |
"context" | |
"encoding/json" | |
"errors" | |
"fmt" | |
"io" |
View http-unix.go
This file contains 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
package main | |
import ( | |
"log" | |
"net" | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
) | |
// From: https://stackoverflow.com/a/26224019/5563477 |
View http_ssh_tunnel.go
This file contains 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
package main | |
// Forward from local port 8001 to remote port 9999, by ssh tunnel | |
import ( | |
"fmt" | |
"io" | |
"log" | |
"net" | |
"net/http" |
View pycharm-ssh.go
This file contains 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
// main | |
/** | |
* A golang ssh server which supports vscode remote ssh plugin. | |
* | |
* ssh_config: | |
* Host upterm | |
* HostName 192.168.101.135 | |
* Port 2224 | |
* | |
* VSCode remote ssh plugin use this command to setup its server, and use dynamic port fowarding to connect to this server. |
View pic.py
This file contains 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 matplotlib.pyplot as plt | |
import numpy as np | |
import math | |
plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签 | |
plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号 | |
x = np.arange(0, 10, 0.1) |
View prod.sh
This file contains 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
#!/bin/bash | |
# 使用方式: | |
# curl https://gist.githubusercontent.com/corvofeng/f16a1fab54757f32879ae4d326c27518/raw/prod.sh | bash - | |
# curl -sL https://corvo.myseu.cn/xyz/prod.sh | bash - | |
sudo apt install -y git htop tmux zsh cscope ranger | |
function save_env() { | |
# 必须有两个参数, key, value | |
[ $# != 2 ] && return |
View school_sort.js
This file contains 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
// 基于网站 http://www.cunet.com.cn/gaozhao/HTML/239864.html | |
// 姐姐托我给外甥女估分选个学校, 看到了下面这个网址, 可是这里面的信息是没有排序的, 所以自己写了一个排序程序 | |
// 可以按照分数进行排序. | |
var wrap = document.getElementsByClassName('wrap_centerfont'); | |
var tbl = wrap[0].children[2]; | |
var all_tbs = tbl.tBodies[0].children |
View clock_test.c
This file contains 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
/* | |
*======================================================================= | |
* Filename:clock_test.c | |
* | |
* Version: 1.0 | |
* Created on: May 20, 2018 | |
* | |
* Author: corvo | |
* | |
* gcc clock_test.c -o clock_test -lm |
View seu_login.py
This file contains 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 urllib | |
import urllib.request | |
import json | |
import base64 | |
def init(): | |
res = urllib.request.urlopen('http://w.seu.edu.cn/index.php/index/init') | |
body = res.read() |
View super_fibonacci.cpp
This file contains 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
// 笔试题目的简单实现 | |
// 请看博客: https://corvo.myseu.cn/2018/04/20/2018-04-20-斐波那契数列的Log(n)解法/ | |
#include <vector> | |
#include <iostream> | |
#include <sstream> | |
#include <string> | |
#include <vector> | |
#include <limits.h> | |
#include <cstdio> |
NewerOlder