- windows下每行结尾为回车+换行(CR+LF),即 \r\n
- unix和macOS下每行结尾为换行LF,即 \n
- classic macOS(最后一个版本为1999年发布的Mac OS 9,可忽略)下为回车,即 \r
settings > Editor > Code Style > Line Separator > unix and macOS (\n)
| Windows Registry Editor Version 5.00 | |
| [HKEY_CLASSES_ROOT\Directory\Background\shell\wt] | |
| @="Windows Terminal Here" | |
| "Icon"="%USERPROFILE%\\AppData\\Local\\Terminal\\terminal.ico" | |
| [HKEY_CLASSES_ROOT\Directory\Background\shell\wt\command] | |
| @="C:\\Users\\用户名\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe" |
| #!/bin/sh | |
| git filter-branch -f --env-filter ' | |
| OLD_NAME="oldName" | |
| OLD_EMAIL="oldMail" | |
| CORRECT_NAME="newName" | |
| CORRECT_EMAIL="newMail" | |
| if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ] |
| Windows Registry Editor Version 5.00 | |
| [HKEY_CLASSES_ROOT\*\shell\文件哈希校验] | |
| "SubCommands"="MACTripleDES;MD5;RIPEMD160;SHA1;SHA256;SHA384;SHA512" | |
| "MUIVerb"="文件哈希校验" | |
| [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\MACTripleDES] |
| [Version] | |
| Signature="$Windows NT$" | |
| [DefaultInstall] | |
| AddReg=SublimeText3 | |
| [SublimeText3] | |
| hkcr,"*\\shell\\SublimeText3",,,"用 SublimeText3 打开" | |
| hkcr,"*\\shell\\SublimeText3","Icon",0x20000,"%1%\sublime_text.exe, 0" | |
| hkcr,"*\\shell\\SublimeText3\\command",,,"""%1%\sublime_text.exe"" ""%%1"" %%*" |
| version: "2" | |
| services: | |
| gogs: | |
| container_name: gogs | |
| image: gogs/gogs | |
| ports: | |
| - 3000:3000 | |
| volumes: | |
| - ./data/gogs/data:/data | |
| environment: |
| #!/usr/bin/env groovy | |
| def call(String buildResult) { | |
| if ( buildResult == "SUCCESS" ) { | |
| slackSend color: "good", message: "Job: ${env.JOB_NAME} with buildnumber ${env.BUILD_NUMBER} was successful" | |
| } | |
| else if( buildResult == "FAILURE" ) { | |
| slackSend color: "danger", message: "Job: ${env.JOB_NAME} with buildnumber ${env.BUILD_NUMBER} was failed" | |
| } | |
| else if( buildResult == "UNSTABLE" ) { |
| /* | |
| *@desc randPassword 生成随机密码 | |
| *@params {Object} -option | |
| *@params {Number} -option.len 密码长度,默认8位 | |
| *@params {Boolean} -option.special 是否包含特殊字符,默认不包含 | |
| */ | |
| function randPassword(option) { | |
| let arr = ['abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '1234567890', '~!@#$%^&*()_+";",./?<>']; | |
| const rand = (min, max) => { | |
| let num = Math.floor(Math.max(min, Math.random() * max)); |
| const fs = require('fs'); | |
| fs.watchFile('./test.txt', function (cur, pre) { | |
| if (!pre.isFile() && cur.isFile()) { | |
| console.log('==>file created'); | |
| } | |
| else if (pre.isFile() && !cur.isFile()) { | |
| console.log('==>file deleted'); | |
| } | |
| else if (pre.isFile() && cur.isFile() && Date.parse(pre.mtime) !== Date.parse(cur.mtime)) { |