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
from mitmproxy import ctx | |
class Replacer: | |
def __init__(self): | |
self.num = 0 | |
def response(self, flow): | |
self.num = self.num + 1 | |
flow.response.content = flow.response.content.replace('知道'.encode(), '知道个屁'.encode()) |
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
require 'continuation' | |
def strange | |
callcc { |cont| return cont } | |
print "Back in method, " | |
end | |
print "Before method. " | |
c = strange() | |
print "After method. " | |
c.call if c |
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
""" | |
有限状态机CR demo | |
""" | |
import inspect | |
import random | |
import threading | |
from _thread import _local | |
import dill as pickle | |
from functools import partial |
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
<html> | |
<title>照片元信息转换为GeoJSON数据并可视化</title> | |
<style> | |
.thumb, canvas { | |
height: 75px; | |
border: 1px solid #000; | |
margin: 10px 5px 0 0; | |
} | |
#container { |
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
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], |
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
#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 |
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
#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 |
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
#!/bin/bash | |
check_internet_connection() { | |
return $(ping -c 1 www.baidu.com > /dev/null) | |
} | |
SSID=$1 | |
PW=$2 | |
while [ 1 ]; do | |
check_internet_connection |
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
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 |
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
// ==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== |