David Gerrells created an app that turns a video into pure CSS. Reading about how he did it has left me both amazed and disgusted – which happens more often than you’d think doing this job.
Rspack 1.0 just came out and is officially stable and ready to mingle.
Self-proclaimed “type nerd” Gabriel Vergnaud released a library of composable functions for TypeScript called HotScript. Megan Thee Stallion is also listed as a contributor.
Dan Mindru wrote about How he cut 22.3 seconds of an API call using Trace View, and he’s hosting a free workshop to show you how to do it too. He’s not the hero we deserve, but he’s the one we need right now. [sponsored]
Oskar Wickström created a theme to celebrate his love of monospaced fonts. As Meg from Hercules would say, “People do crazy things when they’re in love.”
Rodrigo Pombo just released v1.0 of Code Hike.
Automattic is migrating Tumblr to WordPress. They better preserve all the fanfic I wrote about Taylor Swift’s cats that helped me get Tumblr-famous back in 2014 (37 total reblogs).
Nick Schneeberger and Benjamin Hanimann created a collection of 242 free APIs. Unlike other API lists, these are tested every 24 hours and assessed a reliability score.
Material UI v6 comes with React 19 support, container queries, and celebrates the 10-year anniversary since its initial commit.
Chris Fallin wrote about Compiling JavaScript to Wasm. If your article bingo card included the terms “WarpMonkey”, “Winliner”, and “Octane” please come forward to collect your prize.
function filterRecommendations(purchasedProducts, potentialRecommendations) {
return potentialRecommendations.filter(
(product) => !purchasedProducts.includes(product)
);
}
We can improve this code by using a Set
to store the purchasedProducts
list. Because Set
allows us to check for the existence of a value in constant time, we can avoid the linear time lookup that Array.includes
requires. In theory, this should make the function significantly faster for large lists of products (but you should always benchmark your code to be sure).
function filterRecommendations(
purchasedProducts,
potentialRecommendations
) {
const purchasedProductsSet = new Set(purchasedProducts);
return potentialRecommendations.filter(
(productId) => !purchasedProductsSet.has(productId)
);
}
console.time("Recommendations");
const purchasedProducts = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const potentialRecommendations = [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
const result = filterRecommendations(
purchasedProducts,
potentialRecommendations
);
console.log(result); // [11, 12, 13, 14, 15]
console.timeEnd("Recommendations"); // 0.212890625 ms
Built with ❤️ by uidotdev
50 W Broadway Ste 333 PMB 51647 Salt Lake City, Utah 84101
David Gerrells 创建了一个应用程序,将视频转换为纯 CSS。阅读[他是如何做到的](https://click.convertkit-mail4.com/r8u7647ndptoh26l040f2hd60p666h7/58hvh8um8vlgm7f6/aHR0cHM6Ly9kZ2VycmVsbHMuY29tL2Jsb2cvY2FuLXlvdS1jb252ZXJ0LWEtdmlk ZW8tdG8tcHVyZS1jc3M=) 让我既惊讶又厌恶——这种情况发生的频率比你想象的做这项工作要多。
Rspack 1.0刚刚推出正式稳定并准备好进行交流。
自称“类型书呆子”的 Gabriel Vergnaud 发布了一个名为 [HotScript] 的 TypeScript 可组合函数库(https://click.convertkit-mail4.com/r8u7647ndptoh26l040f2hd60p666h7/qvh8h8ur57qdreal/aHR0cHM6Ly9naXRodWIuY29tL2d2ZXJnbmF 1ZC9ob3RzY3JpcHQ=)。 Megan Thee Stallion 也被列为贡献者。
Dan Mindru 写了关于[如何使用 Trace View 缩短 22.3 秒的 API 调用](https://click.convertkit-mail4.com/r8u7647ndptoh26l040f2hd60p666h7/g3hnhwu35dxm3rbr/aHR0cHM6Ly9ibG9nLnNlbnRyeS5pby9ob3ctaS1jdXQtMjIt My1zZWNvbmRzLW9mZi1hbi1hcGktY2FsbC11c2luZy10cmFjZS12aWV3Lz91dG1fY2F tcGFpZ249dHJhY2luZy1meTI1cTMtdHJhY2VibG9nJnV0bV9jb250ZW50PW5ld3NsZXR 0ZXItZGFuc2Jsb2djb3Zlci1yZWFkJnV0bV9tZWRpdW09cGFpZC1jb21tdW5pdHkmdXRtX3NvdXJjZT1ieXRlcw==),并且他正在主持一个[免费研讨会](https://click.convertkit-mail4.com/r8u7647ndptoh26l040f2hd60p666h7/9qhzhdupmqndpwu9/aHR0cHM6Ly9zZW50cnkuaW8vcmVzb3VyY2VzL2Zhc3Rlci1hcGlzLWJldHRlci1leHBlcmllbmNlcy8\_ dXRtX2NhbXBhaWduPXRyYWNpbmctZnkyNXEzLWZhc3RlcmFwaXdvcmtzaG9wJnV0bV9jb250Z W50PW5ld3NsZXR0ZXItRGFud29ya3Nob3AtcnN2cCZ1dG1fbWVkaXVtPXBhaWQtY29tbXVuaXR 5JnV0bV9zb3VyY2U9Ynl0ZXM=) 向您展示如何操作。他不是我们应得的英雄,但他是我们现在需要的英雄。 [赞助]
Oskar Wickström [创建了一个主题](https://click.convertkit-mail4.com/r8u7647ndptoh26l040f2hd60p666h7/3ohphdu7lov37gsr/aHR0cHM6Ly9vd2lja3N0cm9tLmdpdGh1Yi5pby90aGUtbW9ub3NwYWNlLXdlY i8=) 来庆祝他对等宽字体的热爱。正如《大力士》中的梅格所说,“人们在恋爱时会做出疯狂的事情。”
Rodrigo Pombo 刚刚发布了 Code Hike v1.0。
Automattic [将 Tumblr 迁移到 WordPress](https://click.convertkit-mail4.com/r8u7647ndptoh26l040f2hd60p666h7/wnh2h6uwp58qwei7/aHR0cHM6Ly90ZWNoY3J1bmNoLmNvbS8yMDI0LzA4LzI4L3R1bW Jsci10by1tb3ZlLWl0cy1oYWxmLWEtYmlsbGlvbi1ibG9ncy10by13b3JkcHJlc3Mv)。他们更好地保存了我写的所有关于泰勒·斯威夫特的猫的同人小说,这些同人小说帮助我在 2014 年在 Tumblr 上出名(总共 37 条转发)。
Nick Schneeberger 和 Benjamin Hanimann 创建了一系列 242 个免费 API 。与其他 API 列表不同,这些列表每 24 小时进行一次测试并评估可靠性分数。
Material UI v6借助 React 19 支持、容器查询,并庆祝自首次提交以来的 10 周年纪念日。
Chris Fallin 写了关于 [将 JavaScript 编译为pzLw==)。如果您的文章宾果卡包含术语“WarpMonkey”、“Winliner”和“Octane”,请上前领取奖品。
function filterRecommendations(purchasedProducts, potentialRecommendations) {
return potentialRecommendations.filter(
(product) => !purchasedProducts.includes(product)
);
}
我们可以通过使用“Set”来存储“purchasedProducts”列表来改进此代码。因为“Set”允许我们在常量时间内检查某个值是否存在,所以我们可以避免“Array.includes”所需的线性时间查找。从理论上讲,对于大量产品来说,这应该会使该函数的速度显着加快(但您应该始终对您的代码进行基准测试以确保确定)。
function filterRecommendations(
purchasedProducts,
potentialRecommendations
) {
const purchasedProductsSet = new Set(purchasedProducts);
return potentialRecommendations.filter(
(productId) => !purchasedProductsSet.has(productId)
);
}
console.time("Recommendations");
const purchasedProducts = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const potentialRecommendations = [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
const result = filterRecommendations(
purchasedProducts,
potentialRecommendations
);
console.log(result); // [11, 12, 13, 14, 15]
console.timeEnd("Recommendations"); // 0.212890625 ms
由 [uidotdev] 使用 ❤️ 构建(https://click.convertkit-mail4.com/r8u7647ndptoh26l040f2hd60p666h7/m2h7h6u8pgw33gcm/aHR0cHM6Ly91aS5kZXY=)
发布者