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
const waitForJSBridge = new Promise((resolve, reject) => { | |
if (typeof window.StockJSBridge === 'undefined') { | |
let initTimer; | |
let _resolve = () => { | |
window.clearTimeout(initTimer); | |
resolve(); | |
}; | |
initTimer = window.setTimeout(() => { | |
reject(); | |
}, 6000); |
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 scriptLoaded = 0; | |
let scriptDayjs = document.createElement('script'); | |
scriptDayjs.src = | |
'https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.8.16/dayjs.min.js'; | |
let scriptJQuery = document.createElement('script'); | |
scriptJQuery.src = 'https://libs.baidu.com/jquery/2.0.0/jquery.min.js'; | |
let csrf = document.querySelector('meta[name="csrf-token"]').content; | |
let uid = document.cookie.match(/uid=(\d+)/)[1]; | |
let ticker = 0; | |
let limit = 1; |
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
/** | |
* Finds nested promises within the provided value/object and returns one | |
* promise that resolves when all nested promises are resolved. | |
* @param value The value to promisify. | |
*/ | |
export const resolveNestedPromises = async <T>(value: T): Promise<T> => { | |
if (value instanceof Promise) return value; | |
if (value instanceof Array) { | |
const elements = value.map(entry => resolveNestedPromises(entry)); |
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
# sh -c "$(curl -L https://gist.githubusercontent.com/latel/0ce075dbbd47144fc1f3554607749dbd/raw/)" > install.log | |
#######run command above to recover ####### | |
# install homebrew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# directories used to | |
mkdir -p ~/codes/playground | |
mkdir -p ~/codes/stockfe | |
mkdir -p ~/Documents/Tencent/stockfe |
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
var _console = { | |
_disabledGroupFlags: [], | |
log: window.console.log.bind(window.console), | |
info: window.console.info.bind(window.console), | |
debug: window.console.debug.bind(window.console), | |
group: window.console.group.bind(window.console), | |
groupEnd: window.console.groupEnd.bind(window.console) | |
}; | |
window.console.info = function() { | |
// 开发者工具中不显示vConsole的debug print |
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
/*! Metro -v0.2.7 - 2015-05-29 */ | |
!function() { | |
function template(filename, content) { | |
return (/string|function/.test(typeof content) ? compile : renderFile)(filename, content); | |
} | |
function toString(value, type) { | |
return "string" != typeof value && (type = typeof value, "number" === type ? value += "" : value = "function" === type ? toString(value.call(value)) : ""), | |
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
/* | |
* 底部的播放条 | |
* author: Kezhen Wang <[email protected]> | |
* date: 2015/02/05 | |
* version: 0.0.1 | |
*/ | |
define( | |
['LocalEvent', 'manSlider'], | |
function(LocalEvent, manSlider) { |
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 | |
/* vim: set expandtab tabstop=4 shiftwidth=4: */ | |
// +------------------------------------------------------------------------ | |
// Name : Weight Calculat | |
// Description: provide weight calculation | |
// Date : 2013/12/16 08:51 | |
// Authors : latel <[email protected]> | |
// +------------------------------------------------------------------------ | |
// |