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

bitterteaer

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

03 2024 档案

es6完全深拷贝一个对象
摘要:export const deepClone = (obj: object) => { return JSON.parse(JSON.stringify(obj)); }
12
0
0
编辑距离算法
摘要:const levenshteinDistance = (str1: string, str2: string) => { const len1 = str1.length; const len2 = str2.length; const matrix: Array<number[]> = [];
5
0
0
es6过滤对象的某个属性
摘要:使用 Object.entries() 方法将对象转换成一个键值对的数组,然后使用 reduce() 方法遍历这个数组并过滤掉不需要的属性。最后,使用一个空对象作为累加器(acc),将过滤后的属性存储到这个对象中。 const fields = { name: "xxx", age: 18, oth
84
0
0
flask-sqlalchemy orm 框架序列化
摘要:# 如果对象是ORM对象,则将其转换为字典并返回 if isinstance(obj.__class__, DeclarativeMeta): return {c.name: getattr(obj, c.name) for c in obj.__table__.columns}
37
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
点击右上角即可分享
微信分享提示
深色
回顶
收起