Skip to content

Instantly share code, notes, and snippets.

View JichunMa's full-sized avatar
🎯
Focusing

TwoDogSon JichunMa

🎯
Focusing
  • BeiJing,China
View GitHub Profile
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
JichunMa / gist:a341be60974e822f55a3b7ab508efe65
Created July 12, 2017 16:06
The solution of Practice11PieChartView
package com.hencoder.hencoderpracticedraw1.practice;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
#! /bin/bash
dir=~/Desktop/screenshot/
curr=`date "+%Y-%m-%d %H:%M:%S"`
name=${dir}"screenshot"${curr}".png"
echo "${name}"
adb start-server
adb exec-out screencap -p > "$name"
if [ -n "$1" ]; then
echo "$1 秒后自动删除"
sleep $1
def check_contains_blank(source):
if not source:
raise ValueError("source is None")
regular = r"\s"
pattern = re.compile(regular)
result = pattern.search(test_str)
if result is not None:
raise ValueError("{} can't contains whitespace".format(source))
// ==UserScript==
// @name Phabricator copy
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://code.yangqianguan.com/D*
// @grant none
// ==/UserScript==
package com.example.learnkotlin
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
/**
* Created on 2020/4/29.
@JichunMa
JichunMa / numdump_helper.py
Last active November 20, 2022 07:51
Mac numdump helper (need: Python3)
import os
import time
COMPLETE_FILE_DIR = './done/'
# 文件名两边添加双引号
def str_transform(source):
return '\"{}\"'.format(source)