Skip to content

Instantly share code, notes, and snippets.

View zxhfighter's full-sized avatar
🏠
Working from home

ski zxhfighter

🏠
Working from home
View GitHub Profile
@zxhfighter
zxhfighter / pythontips.md
Created November 4, 2013 03:30
use python to start a server

使用python托管文件夹

  • python 3.X: 输入python -m http.server
  • python 2.X: 输入python -m SimpleHTTPServer
@zxhfighter
zxhfighter / get-or-post.md
Last active December 27, 2015 10:39
get or post

get请求和post请求对比

get请求

get请求将查询字符串跟随url发送到服务器,类似如下的格式:

/test/demo_form.asp?name1=value1&name2=value2

参数除了一般的英文字母和数字,有时也免不了要传递一些汉字、特殊符号什么的。

@zxhfighter
zxhfighter / curl.md
Last active December 25, 2019 10:42
curl 命令

curl 命令

如果你再*nix机器下,运行man curl命令查看具体的使用用法。

curl 简介

curl is a tool to transfer data from or to a server, using one of the supported protocols (http, https, ftp, ftps...). The command is designed to work without user interaction.

curl offers a busload of useful tricks like proxy support, user authentication, ftp upload, http post, ssl connections, cookies, file transfer resum and more.

@zxhfighter
zxhfighter / jshint-options.js
Last active December 28, 2015 02:19
jshint options, more details see here: http://jshint.com/docs/options/
{
// if allow use bit-wise operators like ^,|,&
"bitwise": false,
// camelCase or UPPER_CASE
"camelcase": true,
// always use curly braces
"curly": true,
@zxhfighter
zxhfighter / ideas.md
Last active December 28, 2015 02:28
创意汇

创意汇

nginx.conf自动生成程序

前端测试的测试数据来源可以是本地数据桩,也可以来自真实数据,在这两者之间切换时,经常需要修改ngnix.conf文件,可以开发一个小软件,该软件采用c#开发,打包成.exe文件,配置存储在文本文件中。

完成:否

@zxhfighter
zxhfighter / shim-pollyfill.md
Last active November 26, 2017 15:56
shim vs polyfill

shim和polyfill的区别

前端工程师经常会遇到这两个词:shim和polyfill,这两个是啥东西呢?

shim

英文意思为“垫片”,“垫片”一般是为了填充两个事物的缝隙或者使两件事物结合起来。

在JavaScript的世界里,shim就是一个库,用于将一个新的API引用到一个旧环境中,并且仅仅依靠旧环境中已有的手段实现。

@zxhfighter
zxhfighter / 406-error.md
Last active December 28, 2015 04:59
http 406 error

HTTP的406错误

经常和HTTP协议的200,50X,302,404等状态码打交道,这次在使用一个Flash上传控件,上传文件时,在ie下遇到了406。

具体情况描述如下:

chrome可以正常上传,之后接受响应的JSON对象;而ie则返回406(火狐则302重定向了)。

对比两次请求,发现请求头的accept参数不一样,chrome下为*/*,而ie下为text/*,后台框架(spring mvc)处理响应时,默认不支持text/*类型,从而导致了406。

@zxhfighter
zxhfighter / upload-cookie.md
Last active December 28, 2015 05:29
Firefox中,Flash上传文件时,cookie丢失问题
@zxhfighter
zxhfighter / bootstrap.md
Last active December 28, 2015 07:09
bootstrap
  1. bootstrap是由twitter推出的一个开源的前端框架。

  2. bootstrap脚本部分依赖jquery,样式部分采用LESS开发,然后经过编译(即将LESS->CSS)和压缩(压缩脚本和CSS),生成最终版本。

  3. bootstrap诱人特性:友好学习曲线、卓越兼容性、响应式设计、12列网格、基于LESS和jquery、移动支持,使用Normalize支持扩浏览器渲染、媒体查询等等。

  4. 网格系统需要注意的地方:

  • 每一行(.row)必须包含在(.container)中
  • 使用行(.row)来对列进行分组
@zxhfighter
zxhfighter / 2013-11-15.md
Last active December 28, 2015 09:19
some gists recorded on 2013-11-15