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
/* 二叉搜索树 数据结构实现 */ | |
class TreeNode { | |
constructor(key) { | |
this.key = key; | |
this.left = null; | |
this.right = null; | |
} | |
} |
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 orderCancelTime = 48 * 3600 * 1000; | |
const timeCountDown = orderCancelTime - (30 * 60 * 1000); // 半小时开始倒计时 | |
const farawayTime = orderCancelTime - (60 * 60 * 1000); // 1小时以上不倒计时,避免定时器性能问题 | |
export const formatByTimestamp = (timestamp, hasHour) => { | |
let second = Math.floor(timestamp / 1000); | |
if (second < 1) { | |
return ''; | |
} |
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
/** | |
* 百度BOS直传 | |
* @param {*} filePath | |
*/ | |
export default function uploadPicture(filePath) { | |
let filename = uuid() + filePath.substring(filePath.lastIndexOf("/") + 1); | |
const tokenObj = Taro.getStorageSync('bosUploadToken'); | |
let policy = `{"conditions":[{"bucket":"yztfile"},{"key":"${commonPath}${filename}"}]}`; | |
let base64 = Base64.encode(policy) | |
let signature = HmacSHA256(base64, secretAccessKey).toString(EncHex); |
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
{ | |
"parser": "babel-eslint", | |
"plugins": ["react", "react-native"], | |
"env": { | |
"browser": true, | |
"node": true | |
}, | |
"parserOptions": { | |
"ecmaFeatures": { | |
"jsx": true, |
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
'use strict'; | |
const fs = require('fs'); | |
const exec = require('child_process').exec; | |
const npmPackageName = process.env.npm_package_name; | |
const uri = './.gitlab-ci.yml'; | |
const uuid = () => { | |
return `${Math.random() |
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 socket = {}; | |
socket.on('message', function() { | |
// listener 真正拿到结果 | |
}); |
OlderNewer