2025-08-31 11:29:18
欢迎来到第 125 期的【视野修炼 - 技术周刊】,下面是本期的精选内容简介
近期因为身体原因,上机时间较少,码内容断断续续😋,断更了一段时间。
这周超火的图片编辑模型,谷歌出品的 Gemini Flash
,"直接替代 PS"。
可直接上 Google Gemini Web 段体验。
下面给2个案例和提示词(来源于 X 上大佬 @ZHO_ZHO_ZHO 分享)
Use the nano-banana model to create a 1/7 scale commercialized figure of thecharacter in the illustration, in a realistic style and environment. Place the figure on a computer desk, using a circular transparent acrylic base without any text.On the computer screen, display the ZBrush modeling process of the figure. Next to the computer screen, place a BANDAI-style toy packaging box printed with the original artwork.
Generate a highly detailed photo of a girl cosplaying this illustration, at Comiket. Exactly replicate the same pose, body posture, hand gestures, facial expression, and camera framing as in the original illustration. Keep the same angle, perspective, and composition, without any deviation
大家也可以参考文章 实测谷歌Nano Banana,探索更多玩法!
挑一些实用的点:
使用 ESM 替代CJS
导入内置模块使用 node:
前缀以区分第三方模块 ,如 node:fs
import { readFile } from 'node:fs/promises';
await
import { readFile } from 'node:fs/promises';
const config = JSON.parse(await readFile('config.json', 'utf8'));
const response = await fetch('https://api.example.com/data');
const data = await response.json();
AbortController
终止请求const controller = new AbortController();
setTimeout(() => controller.abort(), 10000);
try {
const data = await fetch('https://slow-api.com/data', {
signal: controller.signal
});
console.log('Data received:', data);
} catch (error) {
if (error.name === 'AbortError') {
console.log('Request was cancelled');
} else {
console.error('Unexpected error:', error);
}
}
node:test
// test/math.test.js
import { test, describe } from 'node:test';
import assert from 'node:assert';
import { add, multiply } from '../math.js';
describe('Math functions', () => {
test('adds numbers correctly', () => {
assert.strictEqual(add(2, 3), 5);
});
});
# Run all tests with built-in runner
node --test
# Watch mode for development
node --test --watch
# Coverage reporting (Node.js 20+)
node --test --experimental-test-coverage
{
"name": "modern-node-app",
"type": "module",
"engines": {
"node": ">=20.0.0"
},
"scripts": {
"dev": "node --watch --env-file=.env app.js",
"test": "node --test --watch",
"start": "node app.js"
}
}
这个吊,之前都没了解到👍🏻,完美替代 alias
package.json
中添加 imports
字段
{
"imports": {
"#config": "./src/config/index.js",
"#utils/*": "./src/utils/*.js",
"#db": "./src/database/connection.js"
}
}
import config from '#config';
import { logger, validator } from '#utils/common';
import db from '#db';
基于 GitHub Action 基础能力,自动部署GitHub Pages和定时数据更新。
下面是笔者部署的自己的!
一个简单的工具,可帮助检查目标 URL 页面,哪部分内容是服务端渲染哪部分是CSR渲染。
GitHub风格本地 Diff 工具
npx difit
支持在 Node.js 和浏览器中运行,用于调整大小、裁剪、过滤、颜色调整以及许多其他高级操作的库。
👍🏻比较高级
收藏!
收藏!迟早有一天会用上。
周刊部分内容来源如下渠道,推荐大家关注。
2025-07-31 11:21:21
2月份夹层导致的并发症,6月复查严重了,需要手术治疗
6月29日 入院(泌尿外科)
7月14日 感染新冠(天天都呆在医院里也染上了,离大谱),到现在咳嗽没好
7月17日 手术(住进去还给我拖了半个月,手术耗材要层层审批,审批了7个工作日实在离谱,人都拖死了)
7月18日 出院(做完手术第二天就赶出院了,也没出院带药,也没输液消炎)
7月21日 开始发高烧
7月22日 感染科门诊,开了一堆检查,结果是尿路感染,急性肾损伤(当天白天几乎无尿,无尿就惨了-喝了几瓶水,报告出来立马就跑急诊安排输液消炎,打利尿剂了)
7月23日 通过急诊又入院(感染科,一天输 3 次抗生素)
7月29日 出院(出院带药需要自费去外面购买,医院没有)
2月夹层之后,报告就提示有左肾积水,但当时策略以保命为主,住院华西的医生说不用管这些,后面就没特别关注这个。
肾也是个 BUG 器官,当发现有相关症状的时候问题都是比较严重了
6月复查的时候发现 左肾积水(尿积肾里无法正常排出) 比较严重了(夜尿多,泡泡多),到手术指标了,就立马住院了。
入院后排查是腹部残余夹层导致血管比较粗压迫到左侧输尿管,导致输尿管狭窄
治标就是放置一个输尿管支架,给撑起来,向下图这样,一年一换。
二次入院就是针对性的输抗生素,1天3瓶输了7天,就出院改口服药了。
药是真贵,自费外部购买,线下还非常难买到。
身上 DeBuff 叠满了,出院诊断还有不少小毛病,需要慢慢调养(比如贫血,营养不良啥的)。
连着 2 次住院自费差不多1个w。
开了一堆药和营养品,一天药钱得花个小200¥。
多休息休息调养身体,补充点营养,长点肉(本来就瘦,这次住院又瘦了7-8斤)。
2025-06-22 19:51:15
欢迎来到第 124 期的【视野修炼 - 技术周刊】,下面是本期的精选内容简介
下面开始本期内容的介绍ღ( ´・ᴗ・` )比心。
var figlet = require("figlet");
figlet("Hello World!!", function (err, data) {
console.log(data);
});
_ _ _ _ __ __ _ _ _ _
| | | | ___| | | ___ \ \ / /__ _ __| | __| | | |
| |_| |/ _ \ | |/ _ \ \ \ /\ / / _ \| '__| |/ _` | | |
| _ | __/ | | (_) | \ V V / (_) | | | | (_| |_|_|
|_| |_|\___|_|_|\___/ \_/\_/ \___/|_| |_|\__,_(_|_)
还有 CLI 版本支持
收藏起来,写CLI能用上!
将状态信息存储在URL中,便于持久化当下的用户操作后的页面数据,也便于分享复现。
目前支持Next,React Router,Remix。
原生的 web component,用于代码高亮。
import 'syntax-highlight-element';
<syntax-highlight lang="js">
const a = 1;
</syntax-highlight>
使用非常简单!基于 CSS 自定义高亮API实现。
用于监控 Node.js 应用程序日志的仪表板,实现应用自托管。
使用也比较简单,支持多种日志存储方式!(数据库,文件,内存)
// Import the necessary tools
const express = require('express');
const { setupLogger, viewerMiddleware } = require('log-vwer');
// Create your Express app
const app = express();
const PORT = process.env.PORT || 3000;
// This is an async function to make sure we connect to the database *before* starting the server.
async function startServer() {
// === Part 1: Set up the logger ===
const logger = await setupLogger({
serviceName: 'My Awesome E-Commerce App',
store: 'mongodb',
mongoUrl: 'mongodb://localhost:27017/my_app_logs',
});
// === Part 2: Activate the dashboard ===
// This tells your app: "When someone goes to /_logs, first check the password, then show the log dashboard."
app.use('/_logs', myAuthMiddleware, viewerMiddleware(logger));
// Start your server only after everything is ready
app.listen(PORT, () => {
logger.warn(`Server is alive on port ${PORT}. Ready to rock!`);
console.log(`Log dashboard is live at: http://localhost:${PORT}/_logs`);
});
}
// Run the function to start the server!
startServer();
可以检测网页中的外链,死链等情况。
Chrome 同款风格
宣称是首个无需依赖 TypeScript 编译器(tsc
)、却仍能提供类型感知规则的 JavaScript 和 TypeScript 代码检查工具。
周刊部分内容来源如下渠道,推荐大家关注。
2025-06-15 16:45:19
欢迎来到第 123 期的【视野修炼 - 技术周刊】,下面是本期的精选内容简介
下面开始本期内容的介绍ღ( ´・ᴗ・` )比心。
还没有升级的官方建议跳过 v20 直接使用 v22,剩余更长的生命周期,更多的新特性支持!
🤡 公司里主流还在用 Node 16,基建拉胯,XS!
Oxlint 的第一个稳定版本已经发布!它的性能比 ESLint 提升了 50 到 100 倍 ,支持超过 500 条 ESLint 规则。
支持 0 配置直接启动使用。
npx oxlint@latest
提供更清晰的诊断信息
尝鲜,笔者项目也准备迁一下试试
简洁的 ORM 库,支持 TypeScript 和 JavaScript,以及 CommonJS 和 ESM。
利用 matchMedia API 及其监听器,结合 prefers-color-scheme 媒体查询实现。
使用也超简单!
import darkmodejs from '@assortment/darkmodejs'
function onChange(activeTheme, themes) {
switch (activeTheme) {
case themes.DARK:
console.log('darkmode enabled')
break
case themes.LIGHT:
console.log('lightmode enabled')
break
case themes.NO_PREF:
console.log('no preference enabled')
break
case themes.NO_SUPP:
console.log('no support sorry')
break
}
}
darkmodejs({ onChange })
antfu 大神的又一力作。
npx node-modules-inspector
多种视图下查看依赖的情况。
文章介绍了 4 种常用的限流算法:令牌桶、漏水桶、固定窗口、滑动窗口。
每种算法都提供了可交互的 Demo 方便理解。
令牌桶 | 漏水桶 |
---|---|
2025-06-07 18:58:38
欢迎来到第 122 期的【视野修炼 - 技术周刊】,下面是本期的精选内容简介
下面开始本期内容的介绍ღ( ´・ᴗ・` )比心。
可以将普通图片转为 HDR 图片。
前段时间刷屏(闪瞎iOS)的青蛙图制作!
收藏!
支持在线添加滤镜,裁剪的 WebGL 驱动的编辑器器。
看一下 Hello World 对比。
涵盖了基础入门的知识。
看上去十分nb,收藏一下
“浏览器公司” 解释停止开发 Arc 的原因。
转向开发新的浏览器 Dia (AI浏览器),不再为 Arc 开发新功能
笔者拿这个一直作为主力浏览器,贼好用哎。
Dia 浏览器 先排上队了。
周刊部分内容来源如下渠道,推荐大家关注。
2025-06-06 20:17:59
MD标题外链转二维码
如图给 markdown 内容中带连接的标题下插入一个二维码和连接内容。
方便用户阅读时扫码直接访问或者复制链接。
已支持能力
体验地址:
发公众号的话,搭配 微信 Markdown 编辑器(https://md.doocs.org/) 效果更加。
微信公众号的个人的文章无法直接跳转第三方的外链,文章通常会是外链转脚注,将相关链接放在最后。
但周刊类型的文章外链较多,不太方便用户 CV 跳转。
之前在其它公众号有看到过类似的展示,就想着复刻过来!
用 Trae(Claude-3,7-sonnet)生成核心代码(99%),人工主要在一些特定的样式问题上做了介入。
Vue 3 + Vite
第一轮对话的“提示词”
使用Vite Vue实现一个md 格式转换项目,将Markdown中标题是超链接的提取出来,
放在标题下方 并在左侧生成对应的二维码图片
支持预览原Markdown和转换后Markdown内容
总共进行了 15 轮的连续对话,就达到了这个效果。
其中部署 GitHub Pages 的 GitHub Action 脚本也是用其生成的。
现在有了 VibeCoding 的编码方式,出 Demo 非常的快,效率比人工高 N 倍。
可以快速验证想法。
顺便推荐一波此类型的在线工具
Trae 整体体验我觉得还行,3$ 的首月体验还可以接受,大模型都一样,这比 Cursor 便宜太多了。还没搞上AI IDE 的可以试用一波,每天也有些免费额度。
读者有发一些奇思妙想的应用想法,也可评论区来一波。
不多说了“两个字” AI NB