This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function serialize(obj) { | |
| var str = []; | |
| for(var p in obj) | |
| str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); | |
| return str.join("&"); | |
| } | |
| function parse_qs(qs){ | |
| qs.replace(/^.*\?|#.*$/g, ''); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from multiprocessing import Pool | |
| def fun(x): | |
| print x | |
| if __name__ == '__main__': | |
| pool = Pool(processes=5) | |
| with open('log', 'r+') as f: | |
| for line in f: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Dim inactive windows using 'colorcolumn' setting | |
| " This tends to slow down redrawing, but is very useful. | |
| " Based on https://groups.google.com/d/msg/vim_use/IJU-Vk-QLJE/xz4hjPjCRBUJ | |
| " XXX: this will only work with lines containing text (i.e. not '~') | |
| function! s:DimInactiveWindows() | |
| for i in range(1, tabpagewinnr(tabpagenr(), '$')) | |
| let l:range = "" | |
| if i != winnr() | |
| if &wrap | |
| " HACK: when wrapping lines is enabled, we use the maximum number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| PID_FILE=/var/run/mongo.pid | |
| MONGOD=/opt/mongodb-linux-x86_64-2.0.6/bin/mongod | |
| ### | |
| # main point | |
| ### | |
| case "$1" in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| # | |
| # docker.sh | |
| # Copyright (C) 2015 george.li <vagrant@vagrant-ubuntu-trusty-64> | |
| # | |
| # Distributed under terms of the MIT license. | |
| # | |
| img="tagtoo/quick-env" |
OlderNewer