Skip to content

Instantly share code, notes, and snippets.

@AlloVince
AlloVince / gist:9087216
Created February 19, 2014 06:48
Python蛋疼的Url Parser
url = urlparse.urlparse(url)._asdict()
query = urlparse.parse_qs(url['query'])
query['id'] = 1
url['query'] = urllib.urlencode(query)
url = urlparse.urlunparse(url.values())
gantt
dateFormat  YYYY-MM-DD
title A股项目

section 基础
数据库设计 [元素,桢航]        :active,  base_db, 2015-04-11, 3d
前端调查选型[子龙,点圈] :active, base_front, 2015-04-11, 3d
@AlloVince
AlloVince / gist:4ec938b41ee2142333ca
Last active August 29, 2015 14:24
RESTFul App处理逻辑
//请求成功返回2XX
if (statusCode.startWith('2')) {
//请求成功,处理业务
} else {
//5XX错误,服务器有问题
if (statusCode.startWith('5')) {
//响应格式不定,显示网络错误或未知错误给用户
} elseif (statusCode.startWith('4')) {
//4XX错误,输入有问题
//4XX错误后端必须保证错误格式
function testArray(array $array){
sort($array);
$max = array_pop($array);
$arrLen = count($array);
$len = pow(2, $arrLen);
for($i = 0; $i < $len; $i++){
$byte = sprintf('%0+'. $arrLen . 'b', $i);
$cache = array();
for($j = 0; $j <$arrLen; $j++) {

PHP:

echo md5(file_get_contents('test.torrent'));
//e699b0e7535cebc1b10de1613d6797fb

Python:

@AlloVince
AlloVince / php_code_review.md
Last active May 7, 2019 07:34
npm install -g reveal-md && wget -q -O php_code_review.md https://gist.githubusercontent.com/AlloVince/a656e2842c7b6a43c81d/raw/php_code_review.md && reveal-md php_code_review.md

PHP Code Review

2015.07.31 @AV


什么是好代码


@AlloVince
AlloVince / EvaEngine.js.md
Last active May 7, 2019 08:38
npm install -g reveal-md && wget -q -O EvaEngine.js.md https://gist.githubusercontent.com/AlloVince/cb92c08e0b1c9e5b8b4f6becae12cc5d/raw/EvaEngine.js.md && reveal-md EvaEngine.js.md

EvaEngine.js

2016-2018 @AlloVince


什么是EvaEngine.js


@AlloVince
AlloVince / yeoman.md
Last active May 7, 2019 08:39
npm install -g reveal-md && wget -q -O yeoman.md https://gist.githubusercontent.com/AlloVince/8a53f1ff58748c719d15cbbe91ff5bd5/raw/yeoman.md && reveal-md yeoman.md

使用Yeoman生成项目脚手架

2018.8 @AlloVince


Yeoman

@AlloVince
AlloVince / scrapy.md
Last active May 7, 2019 08:39
npm install -g reveal-md && wget -q -O scrapy.md https://gist.githubusercontent.com/AlloVince/55aa29c8b24c041ee8a832add04f9b40/raw/scrapy.md && reveal-md scrapy.md

如何严肃的写一个爬虫

2018.8 @AlloVince


知名爬虫框架有什么

Convert any Gist Markdown file in to a slide show powered by Reveal.js


Try it out:

https://AlloVince.github.com/gimare/?YOUR_GIST_ID