Nginx 一生只做一次的 Nginx 反向代理配置 作为一个经常需要在 VPS 上面部署各种应用的程序员,我要说 Docker 是真的香,但配置 Nginx 是真的烦。每部署一个新的应用,都要去改一次 Nginx 的配置文件,把它指向我们新部署的应用。每当应用下线的时候,还得记得手动去把对应的配置删掉。
VS Code Awesome console.log(tips) Insert console.log() Install extension: v-snippets Type cl and then press TAB, it expand to console.log() Usage: cl => console.log() cw => console.warn() ce => console.error() ... Wrap selected code Install extension: javascript console utils Usage:
Better Unit Testing Unit tests Unit = Unit of work This could involve multiple methods and classes invoked by some public API that can: Return a value or throw an exception Change the state of the system Make 3rd party calls Basic Test case Test suit Stub Mock Coverage Test case A test case
JetBrains 用WebStorm在团队中共享前端项目配置 众所周知,在团队中统一代码风格是一件很重要但实践起来却非常困难的事情。在过去,我们为了实现整个项目代码风格的一致,需要制定一套冗长的规范,然后要求团队每个成员阅读并按照规范来编写代码,这就要求每个新成员需要一个很长的学习周期才能比较好的融入团队。同时,对新成员而言,一个陌生项目的初始化和各项配置也是一件非常麻烦的事情,需要较高的学习成本。
shell Mac和Linux下搜索并操作文件命令 find 命令 # 找到 src/ 目录中的 file.txt 文件 find src/ -name 'file.txt' # 找到 src/ 目录中的所有 txt 文件 find src/ -name '*.txt' -exec 参数 以复制所有找到的文件至 dest/ 目录为例,命令如下 Mac 下 find src/ -name 'file.txt' -exec rsync -R {} dest/ \; Linux 下 find src/ -name 'file.txt' -exec cp --parents
safari 开启 MacOS 下应用内嵌页开发者工具 先上最终效果 开启方式 在终端中输入命令 defaults write com.sample.yourApp WebKitDeveloperExtras -bool true 其中com.sample.yourApp是你要调试的程序的Bundle identifier。 如果不知道值是多少,可以在应用程序中找到你想调试的程序,点击右键=>显示包内容=>在Contents/Info.plist文件中查找CFBundleIdentifier。
FTP Windows Server 2012下IIS8.0配置FTP服务 自从上次博客挂掉,丢失了所有数据之后就好长一段时间没有写东西了。今天稍微折腾了一下 Windows 服务器,配置的过程中找了几篇文章,都没有看比较全面的讲解,踩坑不少,浪费了不少时间,感觉有必要做一些总结。我们一步一步来吧。