Team Explorer/Home/Settings/Global Settings[Repository Settings]/Rebase local branch when pulling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// reference: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/how-to-write-a-copy-constructor | |
class Person | |
{ | |
// Copy constructor. | |
public Person(Person previousPerson) { | |
Name = previousPerson.Name; | |
Age = previousPerson.Age; | |
} | |
//// Alternate copy constructor calls the instance constructor. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo chown -R $USER /path/to/directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.Store.update({}, {$pull: {vegetables: {$in: ['v1', 'v2']}, fruits: 'f1'}}, {multi: true}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm C:\path\to\delete -r -fo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stores.js | |
const moduleA = { | |
state: {}, | |
mutations: {}, | |
actions: { | |
action2({dispatch) { | |
dispatch('action1', null, {root: true}); // add {root:true} in dispatch method | |
} | |
}, | |
getters: {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ensure The Write Nginx Config Correctly | |
server { | |
listen 443 ssl; # ssl is necessary | |
server_name www.example.com; | |
ssl_certificate www.example.com.crt; | |
ssl_certificate_key www.example.com.key; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_ciphers HIGH:!aNULL:!MD5; | |
... | |
} |
win + R -> cmd
cd \path\to\nssm.exe
nssm install <start-up-service>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 不加参数的 Action 参数可以传拥有任意数目参数的函数 | |
protected void udpCommand(Action command) | |
{ | |
while(!linkDownFail) | |
{ | |
try | |
{ | |
command(); | |
break; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals | |
function template(strings, ...keys) { | |
return ((...values) => { | |
const dict = values[values.length - 1] || {}; | |
const result = [strings[0]]; | |
keys.forEach((key, i) => { | |
const value = Number.isInteger(key) ? values[key] : dict[key]; | |
result.push(value, strings[i + 1]); | |
}); |