目录
-
有趣的算法
-
业务型
- 格式化文件大小——基础
- 格式化文件大小——复杂(直接使用 filesize 库)
- 文件魔数(使用 file-type 库)
- 小数四舍五入
- 根据对象路径处理对象属性
- 项目版本排序
- 快照历史 redo-undo
- 获取范围内合适的数据
- 数字范围内增减
- url 正则功能 (使用 path-to-regexp, 功能强大)
- 事件 bus mitt
- 获得扁平的数据键
- 下载文件
- 字符串 JSON 增强,可以使用函数等结构 (使用 serialize-javascript)
- ip 地址 (直接使用 ip-address)
- 函数柯里化
- 偏函数
- 存根
- 数组树过滤
- 阅读时间
- 生成唯一id
- 缓存
- LRU (最近最少使用)
- LFU (最不经常使用)
- 超时过期
- 前端深拷贝
- 树 [TODO]
- 树
- promise [TODO]
-
data structure
-
排序
- 冒泡
-
查找
-
leetcode
-
小程序 (后期可能建立单独项目)
- 机器人寻路 (未完成)
- 编程语言 (TODO)
- 像素绘图 (TODO)
- 防火墙代理:控制网络资源的访问,保护主题不让“坏人”接近。
- 远程代理:为一个对象在不同的地址空间提供局部代表,在 Java 中,远程代理可以是一个虚拟机中的对象。
- 保护代理:用于对象应该有不同访问权限的情况。
- 智能引用代理:取代了简单的指针,它在访问对象时执行一些附加操作,比如计算一个对象被引用的次数。
- 写时复制代理:通常用于复制一个庞大对象的情况。写时复制代理延迟了复制的过程,当对象被真正修改时,才对它进行复制操作。写时复制代理是虚拟代理的一种变体,DLL (操作系统中的动态链接库)是其典型运用场景。
https://jorgechavez.dev/2020/11/12/string-hashing/
function hash(word) {
var p = 31;
var m = 1e9 + 9;
var hash_value = 0;
for(var i = 0; i < word.length; i++) {
var letter = word[i];
var charCode = letter.charCodeAt();
hash_value = hash_value + (charCode * Math.pow(p, i))
}
return hash_value % m;
}
console.log(hash("apple"));
http://jvns.ca/blog/2021/06/08/reasons-why-bugs-might-feel-impossible/
很难复现 你不太了解整个系统 很难获得有关该错误的数据 你的假设之一是错误的 这个bug真的很复杂
https://github.com/Stuk/jszip 压缩文件
基础设施即代码? https://github.com/run-x/opta
https://zhuanlan.zhihu.com/p/58622271
https://bart.degoe.de/building-a-full-text-search-engine-150-lines-of-code/
Leaflet
https://github.com/rubickCenter/rubick
https://github.com/bitwiseshiftleft/sjcl
qier-progress
https://github.com/alibaba/formily
https://github.com/zerosoul/rc-bullets
https://github.com/svrxjs/svrx
https://github.com/yinxin630/fiora
https://github.com/liriliri/licia
https://github.com/GoogleChromeLabs/squoosh
https://github.com/zhuyingda/veneno
https://github.com/os-js/OS.js
安全性 https://github.com/jpillora/xdomain
[本周的代码]
https://github.com/bradtraversy/50projects50days
https://github.com/chinanf-boy/didact-explain
https://github.com/yjhjstz/deep-into-node
https://github.com/xitu/js-stack-from-scratch
************** 8 月份必读 http://www.craftinginterpreters.com/contents.html
************** 9 月份必读 https://icyfenix.cn/distribution/secure/service-security.html
https://github.com/trekhleb/javascript-algorithms/blob/master/README.zh-CN.md
https://github.com/arqex/freezer
http://jeremyckahn.github.io/keydrown/
pegjs http://fogus.github.io/lemonad/test.html
https://github.com/albertogasparin/Optiscroll
https://github.com/lagodiuk/decision-tree-js
http://vanilla-masker.github.io/vanilla-masker/
https://github.com/aaditmshah/lexer
https://github.com/spckio/spck-embed
https://github.com/bfattori/LogJS
https://github.com/pimterry/loglevel
https://github.com/krasimir/deb.js/blob/master/lib/deb.js
https://github.com/mrmartineau/trak.js
https://github.com/iofjuupasli/guard
https://github.com/sbstjn/timesheet.js/blob/master/source/javascripts/timesheet.js
https://phiresky.github.io/blog/2021/hosting-sqlite-databases-on-github-pages/
该算法是Gunther Greiner和Kai Hormann的“任意多边形的有效裁剪”的粗略实现。您可以在浏览器或节点中使用它。
https://github.com/w8r/GreinerHormann/tree/master/src
https://github.com/peggyjs/peggy/blob/main/examples/semver.peggy