Skip to content

Instantly share code, notes, and snippets.


_Mark24_(张阳) Mark24Code

Block or report user

Report or block Mark24Code

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:94faddf82d4fde234fb26f01072773c2
git log --numstat --pretty="%H" <HashStart>..<HashEnd> | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d,-%d\n",plus,minus)}'\n
Mark24Code /
Created Apr 8, 2018 — forked from datagrok/
Circular imports in Python 2 and Python 3: when are they fatal? When do they work?

When are Python circular imports fatal?

In your Python package, you have:

  • an that designates this as a Python package
  • a, containing a function action_a() that references an attribute (like a function or variable) in, and
  • a, containing a function action_b() that references an attribute (like a function or variable) in

This situation can introduce a circular import error: module_a attempts to import module_b, but can't, because module_b needs to import module_a, which is in the process of being interpreted.

But, sometimes Python is magic, and code that looks like it should cause this circular import error works just fine!

Mark24Code / unorderArr.js
Created Jan 10, 2018
View unorderArr.js
function unorderArr(arr){
let carr = arr.concat();
return 0.5-Math.random()
return carr
Mark24Code / base64toBob&AxiosUploadFile.js
Last active Jan 10, 2018
View base64toBob&AxiosUploadFile.js
//base64转 bob文件
function dataURItoBlob(dataURI) {
// convert base64/URLEncoded data component to raw binary data held in a string
var byteString;
if (dataURI.split(',')[0].indexOf('base64') >= 0)
byteString = atob(dataURI.split(',')[1]);
byteString = unescape(dataURI.split(',')[1]);
// separate out the mime component
# encoding: utf-8
author: mark24
date: 2017.08.09
Mark24Code / README.txt
Last active Jul 17, 2017
View README.txt
filename:编译后的目标文件,相对路径是 dist
template:明确的模板,相对路径是 项目根目录
然后,来源,是 entry一一对应的入口(这是隐藏的)
大原则,就是,和 webpack.base.config.js的Entry一一对应
View 转换px到rem函数
import re
newlines = []
with open('ff','r',encoding='UTF-8') as f:
lines = f.readlines()
for line in lines:
m ='.+: (\d.px).+',line)
newline = ''
if m:
Mark24Code /
Last active Jun 23, 2017
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta, date
now_datetime =
cook_what = 'zhou' #
cooked_time = '6:00:00' # 次日时间
cook_menu = {
Mark24Code / _base.scss
Created Jun 5, 2017
微信小程序Gulp & Sass
View _base.scss
@charset "UTF-8";
@function rpx($v) {
@return $v/1px * 1rpx;
Mark24Code /
Created May 8, 2017 — forked from SaulLawliet/
查询饿了么品牌馆中有哪些是 <真·五折>
# coding: utf-8
import json
import re
import requests
# 替换成你自己的经纬度数据
# 查询方式 打开饿了么官网 -> 开发者模式 -> 输入送餐地址 -> 观察请求 -> 找到经纬度数据
latitude = 31.23978
longitude = 121.49968
You can’t perform that action at this time.