Skip to content

Instantly share code, notes, and snippets.

" Plugin 'dracula/vim'
" for indent
set autoindent
" tab and space
set smarttab
set tabstop=4
set shiftwidth=4
set expandtab
" fold
Plugin 'dracula/vim'
" for indent
set autoindent
" tab and space
set smarttab
set tabstop=4
set shiftwidth=4
set expandtab
" fold
@zhang-ning
zhang-ning / tmux-cheatsheet.markdown
Created February 5, 2017 06:30 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表

Tmux 快捷键 & 速查表

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

tmux at [-t 会话名]
This file has been truncated, but you can view the full file.
package {
public class InstanceFactory {
private static var _photoEditor:IPhotoEditor;
private static var _mainApplication:IMainApplication;
public static function get photoEditor():IPhotoEditor{
return (_photoEditor);
}
@zhang-ning
zhang-ning / form.js
Created August 7, 2016 11:12
sending form to hiiden iframe
//copyed from https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Sending_forms_through_JavaScript
// Let's create the iFrame used to send our data
var iframe = document.createElement("iframe");
iframe.name = "myTarget";
// Next, attach the iFrame to the main document
window.addEventListener("load", function () {
iframe.style.display = "none";
document.body.appendChild(iframe);
});
@zhang-ning
zhang-ning / xss.js
Created August 2, 2016 07:40 — forked from daogurtsov/xss.js
xss escaping and parsing html entities
var entityMap = {
"&": "&",
"<": "&lt;",
">": "&gt;",
'"': '&quot;',
"'": '&#39;',
"/": '&#x2F;'
};
var htmlMap = {
@zhang-ning
zhang-ning / wechat-useragent.js
Last active September 2, 2015 13:47 — forked from GiaoGiaoCat/wechat-useragent.js
微信内置浏览器UserAgent的判断
// 检测浏览器的 User Agent 应该是非常简单的事情
// 微信在 Android 下的 User Agent
mozilla/5.0 (linux; u; android 4.1.2; zh-cn; mi-one plus build/jzo54k) applewebkit/534.30 (khtml, like gecko) version/4.0 mobile safari/534.30 micromessenger/5.0.1.352
// 微信在 iPhone 下的 User Agent
mozilla/5.0 (iphone; cpu iphone os 5_1_1 like mac os x) applewebkit/534.46 (khtml, like gecko) mobile/9b206 micromessenger/5.0
// 通过javascript判断
// 很容易看出来,微信的 User Agent 都有‘micromessenger’字符串标示,我们判断是否含有这些字符串就OK了
function isWeixinBrowser(){
@zhang-ning
zhang-ning / minimap.js
Last active August 29, 2015 14:26 — forked from laughinghan/minimap.js
Minimap of a web page
javascript:
var minimap = document.body.cloneNode(true);
[].forEach.call(minimap.getElementsByTagName('a'), function(link) {
link.href = 'javascript:;';
});
minimap.style.position = 'fixed';
minimap.style.webkitTransform = 'scale(.1)';
document.body.appendChild(minimap);
minimap.style.top = minimap.offsetHeight*-.45+'px';
minimap.style.right = minimap.offsetWidth*-.45+'px';
# Install MacTex: http://mirror.ctan.org/systems/mac/mactex/mactex-basic.pkg
$ sudo chown -R `whoami` /usr/local/texlive
$ tlmgr update --self
$ tlmgr install ucs
$ tlmgr install etoolbox
# Install pandoc view homebrew
@zhang-ning
zhang-ning / 如何创建伟大社区
Created March 18, 2015 19:51
Brick By Brick: A free guide to building awesome communities
http://www.communitybuildingguide.com/