Team Explorer/Home/Settings/Global Settings[Repository Settings]/Rebase local branch when pulling
This file contains 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 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 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 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 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 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 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]); | |
}); |
This file contains 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://docs.mongodb.com/manual/reference/operator/query/expr/#op._S_expr | |
//// $expr can build query expressions that compare fields from the same document in a $match stage. | |
////// Compare Two Fields from A Single Document | |
////// The following operation uses $expr to find documents where the spent amount exceeds the budget | |
db.monthlyBudget.find( { $expr: { $gt: [ "$spent" , "$budget" ] } } ) | |
////// Using $expr With Conditional Statements | |
////// The following operation uses $expr with $cond to mimic a conditional statement. It finds documents where the price is less than 5 after the applied discounts. | |
db.supplies.find( { |