清除safari缓存即可。
原理是因为Apple限制,在iOS上微信只能使用webview。
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
# 1. Download and install the latest Anaconda distribution from https://www.continuum.io/downloads#macos | |
# 2. Create a new Python environment. Make sure you choose python 3.5 as your python version for the virtual environment: | |
conda create -n myenv python=3.5 | |
# 3. Activate the new environment using: | |
source activate myenv |
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
import socket | |
def get_local_ip(): | |
''' | |
获得本机可联网的IP | |
''' | |
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
sock.connect(("baidu.com", 80)) | |
ip = sock.getsockname()[0] | |
sock.close() |
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
import time | |
import uuid | |
def ksuid(): | |
return hex(int(time.time()))[2:] + uuid.uuid4().hex |
参考:http://flask.pocoo.org/docs/0.12/patterns/streaming/#streaming-from-templates
目录结构:
.
├── app.py
└── templates
└── the_template.html
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 | |
from="redis-cli -n 1" | |
to="redis-cli -n 5" | |
while read key; | |
do | |
$to del $key | |
$from --raw dump $key | head -c-1 | $to -x restore $key 0 | |
done < <($from --scan) |
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
# -*- coding: utf-8 -*- | |
# created: Fri Dec 29 10:56:33 CST 2017 | |
# filename: dingtalk_handler.py | |
# author: juntao liu | |
# email: [email protected] | |
# descritpion: | |
import json | |
import logging | |
import threading |
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 | |
# require curl/wget/jq | |
TOKEN="<API key from https://tinypng.com/developers>" | |
if [ -z "$1" ]; then | |
echo "will create a shrink-<image_name> file" | |
echo "" | |
echo "usage:" | |
echo " tinypng <path/to/image.(png/jpg)>" |
app.listen(xheaders=True)
If xheaders is True, we support the X-Real-Ip/X-Forwarded-For and X-Scheme/X-Forwarded-Proto headers, which override the remote IP and URI scheme/protocol for all requests. These headers are useful when running Tornado behind a reverse proxy or load balancer. The protocol argument can also be set to https if Tornado is run behind an SSL-decoding proxy that does not set one of the supported xheaders.