Skip to content

Instantly share code, notes, and snippets.

View fzdp's full-sized avatar

frey fzdp

View GitHub Profile
@fzdp
fzdp / upyun.js
Created December 1, 2022 04:08
又拍云FORM API结合axios上传示例,对着官方小程序库稍微改了下就能用:https://github.com/upyun/wechat-sdk
/**
* const upyun = new Upyun({
* bucket: "test-bucket",
* operator: "admin-user",
* getSignatureUrl: "https://example.com/upyun/getSignature"
* });
*
* upyun.upload({
* file: file,
* remotePath: '/dev/{year}/{mon}/{day}/{filename}{.suffix}',
@fzdp
fzdp / expression evaluator.py
Created October 21, 2019 14:28
expression evalutor in recursive way using Python
class Expression:
operator_precedence = {'+': 0, '-': 0, '*': 1, '/': 1}
operator_calculator = {
'+': lambda v1,v2 : v1 + v2,
'-': lambda v1,v2 : v1 - v2,
'*': lambda v1,v2 : v1 * v2,
'/': lambda v1,v2 : v1 / v2
}
valid_operators = ['+','-','*','/']