小编Mar*_*ndt的帖子

如何像 GitHub 一样切换到 Chromes 深色滚动条?

我刚刚发现,当您使用 GitHub 的暗模式时,GitHub 在 Chrome 中使用暗滚动条。如果您切换颜色模式,滚动条也会切换。

我怎样才能达到这种行为?我找不到任何方法告诉浏览器使用暗模式。

暗模式滚动条:

暗模式滚动条

html javascript google-chrome darkmode

7
推荐指数
1
解决办法
3023
查看次数

npm 404 未找到,众所周知的包

尝试使用 npm 安装 7zip-bin 包,出现此错误:

npm ERR! code E404
npm ERR! 404 Not Found: 7zip-bin@5.0.3

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/user/.npm/_logs/2020-02-11T22_06_51_357Z-debug.log
Run Code Online (Sandbox Code Playgroud)

在日志文件中,我看到以下输出:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   '7zip-bin@5.0.3' ]
2 info using npm@6.4.1
3 info using node@v8.15.0
4 verbose npm-session 57413e14b663097a
5 silly install loadCurrentTree
6 silly …
Run Code Online (Sandbox Code Playgroud)

npm npm-install

6
推荐指数
1
解决办法
2959
查看次数

如何在 Go 中对某些事情进行计时,这需要不到一纳秒?

如果我想比较两个函数的时间,但这些函数花费的时间不到一纳秒,我该如何进行?

t := time.Now()
_ = fmt.Sprint("Hello, World!")
d := time.Since(t)
d.Round(0)
fmt.Println(d.Nanoseconds()) // Prints 0
Run Code Online (Sandbox Code Playgroud)

我可以运行该函数几次,并将时间除以执行次数,但我更想要一种对单次执行进行计时的方法。有没有办法做到这一点?

benchmarking duration go

0
推荐指数
1
解决办法
766
查看次数