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
// ==UserScript== | |
// @include https://kyfw.12306.cn/* | |
// ==/UserScript== | |
var ctjs = document.createElement("script"); | |
ctjs.type = "text/javascript"; | |
ctjs.innerHTML = "autoSearchTime = 1000;" | |
var head = document.getElementsByTagName("body")[0]; | |
head.appendChild(ctjs); |
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
var callA = function (callback) { | |
setTimeout(function () { | |
callback({name: "a", data: "I am result A"}); | |
}, Math.round(Math.random() * 300)); | |
}; | |
var callB = function (callback) { | |
setTimeout(function () { | |
callback({name: "b", data: Math.round(Math.random() * 300)) % 2 === 0}); | |
}, Math.round(Math.random() * 300)); |
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 redis | |
import web | |
SESSION = 'SESSION:' | |
class RedisStore(web.session.Store): | |
"""Store for saving a session in redis: | |
import rediswebpy | |
session = web.session.Session(app, rediswebpy.RedisStore(), initializer={'count': 0}) |