以下所有的API都有两种方式可调用 http://api?key=value&key2=value2 以及 http://api/key/value/key2/value
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 flask import Flask | |
from flask import request, redirect | |
app = Flask(__name__) | |
@app.route('/', methods=["GET"]) | |
def query_form(): | |
return ''' | |
<!DOCTYPE html> | |
<html lang="en"> |
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
let data = await loadData() | |
let widget = await createWidget(data) | |
// Check if the script is running in a widget. If not, show a preview of the widget to easier debug it -> open the stats webpage in Safari. | |
if (!config.runsInWidget) { | |
// await widget.presentMedium() | |
await Safari.open('https://holo.poi.cat/youtube-stream') | |
} | |
// Tell the system to show the widget. | |
Script.setWidget(widget) | |
Script.complete() |
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
[ | |
"https://gq3brsw46hyrns0w4hjiqhtab8e9q24h93g8estrbgwt4h5h0triosgb80wt.wordpress.com/2016/10/26/%e9%95%bf%e5%b9%b3-%e4%bb%8e%e4%b8%a5%e6%b2%bb%e5%85%9a-%e5%94%af%e6%9c%89%e4%b8%89%e6%9d%83%e5%88%86%e7%ab%8b%e5%be%b7%e5%9b%bd%e4%b9%8b%e5%a3%b0%e4%b8%ad%e6%96%87%e7%bd%91/?from=groupmessage&isappinstalled=0", | |
"https://www.evernote.com/shard/s596/sh/b273afd0-4564-40f2-b81f-57ac23c3b61b/4e2b83c48886db7c1b2c5537d2483a99", | |
"https://won528.wordpress.com", | |
"http://url.cn/28ucN6a", | |
"https://win358.wordpress.com", | |
"https://red6451.wordpress.com", | |
"https://get510.wordpress.com", | |
"https://sit222.wordpress.com", | |
" http://alturl.com/9w4aq", |
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
<?php | |
function saveImage($path) { | |
if(!preg_match('/\/([^\/]+\.[a-z]{3,4})$/i',$path,$matches)) //匹配图片 | |
die('Use image please'); | |
$image_name = strToLower($matches[1]); | |
$ch = curl_init ($path); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_BINARYTRANSFER,1); | |
$img = curl_exec ($ch); | |
curl_close ($ch); |
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
# install openjdk | |
sudo apt-get install openjdk-7-jdk | |
# download android sdk | |
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz | |
tar -xvf android-sdk_r24.2-linux.tgz | |
cd android-sdk-linux/tools | |
# install all sdk packages |
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
/** | |
* 判断两个版本字符串的大小 | |
* @param {string} v1 原始版本 | |
* @param {string} v2 目标版本 | |
* @return {number} 如果原始版本大于目标版本,则返回大于0的数值, 如果原始小于目标版本则返回小于0的数值。0当然是两个版本都相等拉。 | |
*/ | |
function compareVersion(v1, v2) { | |
var _v1 = v1.split("."), | |
_v2 = v2.split("."), |