Skip to content

Instantly share code, notes, and snippets.


TwoDogSon JichunMa

Block or report user

Report or block JichunMa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:6f503c933325391727262750bc9e1069
// ==UserScript==
// @name Phabricator copy
// @namespace
// @version 0.1
// @description try to take over the world!
// @author You
// @match*
// @grant none
// ==/UserScript==
View gist:513abc505d8ca41811f79b93c4a8c0de
def check_contains_blank(source):
if not source:
raise ValueError("source is None")
regular = r"\s"
pattern = re.compile(regular)
result =
if result is not None:
raise ValueError("{} can't contains whitespace".format(source))
View 截图脚本
#! /bin/bash
curr=`date "+%Y-%m-%d %H:%M:%S"`
echo "${name}"
adb start-server
adb exec-out screencap -p > "$name"
if [ -n "$1" ]; then
echo "$1 秒后自动删除"
sleep $1
JichunMa /
Last active Apr 1, 2019
Mac numdump helper (need: Python3)
import os
import time
# 文件名两边添加双引号
def str_transform(source):
return '\"{}\"'.format(source)
View gist:af08d9c24a2fbd527fe6bf2ec3c84c27
headers = {
"Connection": "keep-alive",
"Pragma": "no-cache",
"Cache-Control": "no-cache",
"Upgrade-Insecure-Requests": 1,
"DNT": 1,
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.92 Safari/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en,zh-CN;q=0.9,zh;q=0.8"
JichunMa / gist:f11c947513014581c043f34f539e6093
Last active Aug 3, 2018
shell 命令执行截图保存桌面(支持自动删除)
View gist:f11c947513014581c043f34f539e6093
#! /bin/bash
curr=`date "+%Y-%m-%d %H:%M:%S"`
echo "${name}"
adb exec-out screencap -p > "$name"
if [ -n "$1" ]; then
echo "$1 秒后自动删除"
sleep $1
rm "$name"
JichunMa / gist:13343ab0d09b787f3061ce1e96701ba5
Created May 23, 2018
View gist:13343ab0d09b787f3061ce1e96701ba5
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AreaBean labelBean = (AreaBean) o;
if (label != null ? !label.equals(labelBean.label) : labelBean.label != null) return false;
return value != null ? value.equals(labelBean.value) : labelBean.value == null;
View gist:c2ce28c21def0eda0e700db847d39850
def insert_mysql(list_items):
if len(list_items) == 0:
print('input data illegal')
config = {
'host': '',
'port': 3306,
'user': 'root',
'password': '********',
'db': 'lagouInfo',
View gist:21e8f36d5cd0e11df90afc527e8a669e
detail_data = ''
// 详情页网址
//我把头条详情页存到了本地 toutiao_detai.html
with open('toutiao_detai.html', 'r')as f:
detail_data =
data_list = re.findall("articleInfo: {(.*?)}", detail_data, re.S)
for data in data_list:
url_list = re.findall('(http.*?com)', text, re.S)
for url in url_list:
View gist:b33e9ec04400aad215f809bb2c402f2f
import re
def remove_all_whitespace(source_str):
p = re.compile('\s+')
new_string = re.sub(p, '', source_str)
return new_string
You can’t perform that action at this time.