Skip to content

Instantly share code, notes, and snippets.

View lovemyliwu's full-sized avatar
😍
feel free

Smite Chow lovemyliwu

😍
feel free
View GitHub Profile
// ==UserScript==
// @name 今年GitHub成绩单
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @require http://yckart.github.io/jquery.base64.js/jquery.base64.js
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Smite Chow
// @match https://github.com/*?show_current_year_statistic
// @match https://github.com/*/graphs/contributors?from=*-01-01&to=*-12-31&type=c

###前置知识

会一门基本的命令式编程语言(vb/c/c++/java/js等)或了解基本的编程概念(变量,函数,类等)

###目标

熟悉并能使用Python做一些实际的事情, 一共有三个部分的培训, 每个部分培训时长应在3个小时内,讲演结合.结束之后留有课后作业, 完成课后作业视为达成目标.

online python REPL:https://repl.it/languages/python

// ==UserScript==
// @name Baidu YunPan Video Player +
// @namespace http://tampermonkey.net/
// @version 0.1
// @description auto play next video
// @author Smite
// @match https://pan.baidu.com/play/video*
// @grant none
// ==/UserScript==
class CustomTask(Task):
def on_failure(self, exc, task_id, args, kwargs, einfo):
info = '[{0}] failed: {1}'.format(task_id, exc)
logger.exception(info, exc_info=exc)
super(CustomTask, self).on_failure(exc, task_id, args, kwargs, einfo)
def on_success(self, retval, task_id, args, kwargs):
global app
if app.is_warm_shutdown:
app.consumer.connection._default_channel.do_restore = False
@lovemyliwu
lovemyliwu / wifi_watch_dog.sh
Last active January 28, 2023 07:51
auto reconnect wifi after kick out by router on ubuntu
#!/bin/bash
check_internet_connection() {
return $(ping -c 1 www.baidu.com > /dev/null)
}
SSID=$1
PW=$2
while [ 1 ]; do
check_internet_connection
@lovemyliwu
lovemyliwu / bj-unicom-iptv.m3u
Created March 1, 2019 12:16 — forked from sdhzdmzzl/bj-unicom-iptv.m3u
北京联通iptv列表
#EXTM3U name="bj-unicom-iptv"
#EXTINF:-1,天津卫视高清
rtp:///239.3.1.141:1234
#EXTINF:-1,卡酷少儿
rtp:///239.3.1.50:9248
#EXTINF:-1,爱上4K
rtp:///239.3.1.236:2000
@lovemyliwu
lovemyliwu / bj-unicom-iptv.m3u
Created March 1, 2019 12:16 — forked from sdhzdmzzl/bj-unicom-iptv.m3u
北京联通iptv列表
#EXTM3U name="bj-unicom-iptv"
#EXTINF:-1,天津卫视高清
rtp:///239.3.1.141:1234
#EXTINF:-1,卡酷少儿
rtp:///239.3.1.50:9248
#EXTINF:-1,爱上4K
rtp:///239.3.1.236:2000
@lovemyliwu
lovemyliwu / simplex.py
Last active November 11, 2019 08:57
simplex
def print_variable(basic_idx, none_basic_idx):
b_name = [f'x_{i+1}' for i in basic_idx]
nb_name = [f'x_{i+1}' for i in none_basic_idx]
print(f'基变量有:{b_name}, 非基变量有:{nb_name}')
def get_matrix_for_exchange(none_basic_idx, exchange_none_basic_index):
A = np.array([
[1, 2, 1, 0, 0],
<html>
<title>照片元信息转换为GeoJSON数据并可视化</title>
<style>
.thumb, canvas {
height: 75px;
border: 1px solid #000;
margin: 10px 5px 0 0;
}
#container {
@lovemyliwu
lovemyliwu / fsmcr_demo.py
Created May 30, 2020 07:30
FSM CR demo alternative to call/cc generator(yield)
"""
有限状态机CR demo
"""
import inspect
import random
import threading
from _thread import _local
import dill as pickle
from functools import partial