会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
bitterteaer
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
···
18
下一页
2024年3月29日
编辑距离算法
摘要: const levenshteinDistance = (str1: string, str2: string) => { const len1 = str1.length; const len2 = str2.length; const matrix: Array<number[]> = [];
阅读全文
posted @ 2024-03-29 11:42 bitterteaer
阅读(10)
评论(0)
推荐(0)
2024年3月27日
es6过滤对象的某个属性
摘要: 使用 Object.entries() 方法将对象转换成一个键值对的数组,然后使用 reduce() 方法遍历这个数组并过滤掉不需要的属性。最后,使用一个空对象作为累加器(acc),将过滤后的属性存储到这个对象中。 const fields = { name: "xxx", age: 18, oth
阅读全文
posted @ 2024-03-27 10:40 bitterteaer
阅读(91)
评论(0)
推荐(0)
2024年3月19日
flask-sqlalchemy orm 框架序列化
摘要: # 如果对象是ORM对象,则将其转换为字典并返回 if isinstance(obj.__class__, DeclarativeMeta): return {c.name: getattr(obj, c.name) for c in obj.__table__.columns}
阅读全文
posted @ 2024-03-19 14:33 bitterteaer
阅读(46)
评论(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 = {
阅读全文
posted @ 2024-03-19 11:32 bitterteaer
阅读(51)
评论(0)
推荐(0)
2024年3月4日
git回滚
摘要: 版本回退 git reset --hard <目标版本号> 强制推送 git push -f
阅读全文
posted @ 2024-03-04 16:59 bitterteaer
阅读(20)
评论(0)
推荐(0)
统计80端口连接数
摘要: netstat -nat|grep -i "80"|wc -l
阅读全文
posted @ 2024-03-04 11:01 bitterteaer
阅读(10)
评论(0)
推荐(0)
2024年2月27日
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
阅读全文
posted @ 2024-02-27 11:49 bitterteaer
阅读(207)
评论(0)
推荐(0)
2024年2月24日
SQLAlchemy commit 后会自动重新查询数据库问题
摘要: expire_on_commit=False
阅读全文
posted @ 2024-02-24 10:34 bitterteaer
阅读(39)
评论(0)
推荐(0)
2024年2月2日
js通过Image()获取图片尺寸
摘要: 注意需要在浏览器中使用,需要加载dom对象才能生效,如果直接使用jest将会报错超时 export const getImgSize = (url: string): Promise<{ width: number, height: number }> => { return new Promise
阅读全文
posted @ 2024-02-02 10:53 bitterteaer
阅读(142)
评论(0)
推荐(0)
2024年1月31日
router删除路由参数
摘要: let newQuery = JSON.parse(JSON.stringify(route.query)) // 深拷贝 delete newQuery.aaa delete newQuery.bbb await router.replace({query: newQuery })
阅读全文
posted @ 2024-01-31 16:08 bitterteaer
阅读(32)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
···
18
下一页
公告