This file contains 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
[python: **.py] | |
[jinja2: **/templates/**.html] | |
extensions=jinja2.ext.autoescape,jinja2.ext.with_ |
This file contains 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
import datetime | |
base_dict = { | |
'0': 6, | |
'1': 2, | |
'2': 5, | |
'3': 5, | |
'4': 4, | |
'5': 5, |
This file contains 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
if PY3: | |
string_types = str, | |
integer_types = int, | |
text_type = str | |
xrange = range | |
else: | |
string_types = basestring, | |
integer_types = (int, long) | |
text_type = unicode | |
xrange = xrange |
This file contains 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
Show hidden characters
{ | |
"esnext": true | |
} |
This file contains 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
/** | |
* | |
* 异步 get 需要回调 | |
**/ | |
let choice = 'a'; | |
let proxyList = []; | |
function initProxyWayA() { |
This file contains 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
git status | grep typechange | awk '{print $2}' | xargs git checkout |
This file contains 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
import crypto from 'crypto'; | |
function gen(password) { | |
const randomSalt = crypto.randomBytes(16).toString('base64'); | |
const bufferSalt = new Buffer(randomSalt, 'base64'); | |
const hashPassword = crypto.pbkdf2Sync(password, bufferSalt, 10000, 64).toString('base64'); | |
console.log('salt', randomSalt); | |
console.log('password', hashPassword); | |
return (randomSalt, hashPassword); | |
} |
This file contains 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
javascripts/ | |
stylesheets/ | |
cmap/ | |
vendor/ | |
*.eot | |
*.svg | |
*.ttf | |
*.woff |
This file contains 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
curl -XPUT 'http://localhost:9200/testindex' -d '{ | |
"settings": | |
{ | |
"number_of_shards": 1, | |
"number_of_replicas": 0 | |
} | |
} | |
' | |
curl -XPUT 'http://localhost:9200/testindex/posting/_mapping' -d ' |
This file contains 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
brew install curl | |
brew link curl --force | |
brew install openssl | |
export LIBRARY_PATH=/usr/local/opt/openssl/lib | |
export CPATH=/usr/local/opt/openssl/include | |
pip --no-cache-dir install pycurl | |
python -c "import pycurl" |
OlderNewer