为了能到远方,脚下的每一步都不能少.|

bitterteaer

园龄:3年8个月粉丝:1关注:0

编辑距离算法
摘要: const levenshteinDistance = (str1: string, str2: string) => { const len1 = str1.length; const len2 = str2.length; const matrix: Array<number[]> = [];
6
0
0
es6过滤对象的某个属性
摘要: 使用 Object.entries() 方法将对象转换成一个键值对的数组,然后使用 reduce() 方法遍历这个数组并过滤掉不需要的属性。最后,使用一个空对象作为累加器(acc),将过滤后的属性存储到这个对象中。 const fields = { name: "xxx", age: 18, oth
85
0
0
flask-sqlalchemy orm 框架序列化
摘要: # 如果对象是ORM对象,则将其转换为字典并返回 if isinstance(obj.__class__, DeclarativeMeta): return {c.name: getattr(obj, c.name) for c in obj.__table__.columns}
38
0
0
celery flower api 接口认证
摘要: auth_user = 'admin' auth_passwd = '123456' usrPass = "%s:%s" % (auth_user, auth_passwd) b64Val = base64.b64encode(usrPass.encode('utf-8')) headers = {
26
0
0
git回滚
摘要: 版本回退 git reset --hard <目标版本号> 强制推送 git push -f
5
0
0
统计80端口连接数
摘要: netstat -nat|grep -i "80"|wc -l
4
0
0
Python 中动态调用函数或类的方法
摘要: 使用 importlib # module.py class A: def foo(self): print('this is foo.') @staticmethod def static_method(): print('this is static.') def bar(): print('b
168
0
0
js通过Image()获取图片尺寸
摘要: 注意需要在浏览器中使用,需要加载dom对象才能生效,如果直接使用jest将会报错超时 export const getImgSize = (url: string): Promise<{ width: number, height: number }> => { return new Promise
120
0
0
router删除路由参数
摘要: let newQuery = JSON.parse(JSON.stringify(route.query)) // 深拷贝 delete newQuery.aaa delete newQuery.bbb await router.replace({query: newQuery })
18
0
0
上一页 1 2 3 4 5 6 ··· 18 下一页
上一页 1 2 3 4 5 6 ··· 18 下一页
点击右上角即可分享
微信分享提示
深色
回顶
收起