KeyCastr 按键可视化。例如录制视频教程时很有用,在屏幕上显示当前的按键。 也支持显示鼠标的操作。 开源、免费。 KeyboardCleanTool 暂时锁定键盘和触控板。比如暂时离开电脑时
Alfred是 macOS 下一款知名又好用的启动器工具。基础功能免费,高级功能要付费购买,一次性买断制。 快速启动应用、搜索和 Workflow 和 Snippets 等功能,可以大大提高
Array.shift()
For example:
var arr = [1, 2, 3, 4]; var theRemovedElement = arr.shift(); // theRemovedElement == 1 console.log(arr); // [2, 3, 4]
首先使用 GitHub API 获得项目中每种语言的代码行数, API: https://api.github.com/repos/<user/repo>/l
Use PDM to export Python project dependencies to requirements.txt file.
pdm export --pyproject > requirements.txt
or
pdm export --pyproject -o requirements.txt
Export lockfile
pdm export > requirements.lock
Amplify 自动部署 Hugo 项目在构建前端环节失败,报错某个模板时解析失败。类似: [WARNING]: Error: add site dependencies: load resources: loading templates: ".../layouts/partials/meta/author.html:9:1": parse failed: template: partials/meta/author.html:9: unclosed action [ERROR]: !!! Build failed [ERROR]: !!! Non-Zero Exit Code detected 首先的确是模板文件有语
使用 Array.prototype.join() 以下内容参考 MDN web docs join() 方法将数组中所有元素成一个新的字符串并返回。默认使用逗号作为分隔符或使用指定的分隔字符。 语法: Array.join( ) Array.join(separator) 举例: // Code copied from
How to convert MP3 to OGG audio format?
ffmpeg -i in.mp3 -ar 48000 -vn -c:a libvorbis out.ogg
If you have sample rate errors, use -vn.
References
https://uly.me/ffmpeg-convert-mp3-to-ogg
使用 pexpect 库比较省心,使用方便。也不像使用 subprocess 会出现很多问题。 代码: import pexpect def execute_cli_command(cmd: str) -> str: """return stdout:str""" (command_output, exitstatus) = pexpect.run(cmd, withexitstatus=1) command_output = command_output.decode("utf-8") if exitstatus != 0: raise Exception(exitstatus, command_output) return command_output
CSS: .container{ display: flex; justify-content: center; //水平居中 align-items: center; //垂直居中 } HTML: <div class="container"> <div>居中元素</div> </div>