启动新会话:
tmux [new -s 会话名 -n 窗口名]
恢复会话:
tmux at [-t 会话名]
| #!/bin/sh | |
| SHORTCUT="[Desktop Entry] | |
| Name=Sublime Text 3 | |
| Comment=Edit text files | |
| Exec=/usr/local/sublime-text-3/sublime_text | |
| Icon=/usr/local/sublime-text-3/Icon/128x128/sublime_text.png | |
| Terminal=false | |
| Type=Application | |
| Encoding=UTF-8 | |
| Categories=Utility;TextEditor;" |
| #!/bin/sh | |
| SHORTCUT="[Desktop Entry] | |
| Name=Sublime Text 2 | |
| Comment=Edit text files | |
| Exec=/usr/local/sublime-text-2/sublime_text | |
| Icon=/usr/local/sublime-text-2/Icon/128x128/sublime_text.png | |
| Terminal=false | |
| Type=Application | |
| Encoding=UTF-8 | |
| Categories=Utility;TextEditor;" |
| # JS files | |
| JS_FINAL = js/project-name-all.js | |
| JS_TARGETS = js/file1.js \ | |
| js/file2.js \ | |
| js/file3.js | |
| # CSS files | |
| CSS_FINAL = css/project-name-all.css | |
| STYLUS_TARGETS = css/file1.styl \ |
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://npmjs.org/install.sh | sh |
| inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a | |
| function! s:align() | |
| let p = '^\s*|\s.*\s|\s*$' | |
| if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) | |
| let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g')) | |
| let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*')) | |
| Tabularize/|/l1 | |
| normal! 0 | |
| call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) |
| # 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 |
| 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'; |
| // 检测浏览器的 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(){ |
| var entityMap = { | |
| "&": "&", | |
| "<": "<", | |
| ">": ">", | |
| '"': '"', | |
| "'": ''', | |
| "/": '/' | |
| }; | |
| var htmlMap = { |