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
const euros = [ 29.76, 41.85, 46.5 ]; | |
euros.forEach((val) => { | |
// console.log(val); | |
}); | |
const total = euros.reduce((total, amount) => { | |
total += amount; | |
return total; | |
}); |
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
function minMax(items) { | |
return items.reduce((acc, val) => { | |
acc[0] = acc[0] === undefined || val < acc[0] ? val : acc[0]; | |
acc[1] = acc[1] === undefined || val > acc[1] ? val : acc[1]; | |
console.log(acc); | |
return acc; | |
}, []); | |
} | |
console.log(minMax([ 3, 98, 1, 6, 100 ])); |
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
#################### LINTER GIVES ERROR FOR pg.init() ########################### | |
For VS CODE Open settings.json | |
Search for python.linting.mypyArgs | |
ADD THIS: | |
"python.linting.pylintArgs": [ | |
"----extension-pkg-whitelist=1xml" |
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
################### Find (and kill) process locking port 3000 on Mac ########################## | |
You can try netstat | |
netstat -vanp tcp | grep 3000 | |
For macOS El Capitan and newer (or if your netstat doesn't support -p), use lsof | |
sudo lsof -i tcp:3000 | |
####################################################################################### |
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
Execute the following query in MYSQL Workbench | |
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password' | |
Try connecting using node after you do so |
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
<!-- WIDTH CLASSES --> | |
<div class="bg-success p-3 w-25">Width 25%</div> | |
<div class="bg-success p-3 w-50">Width 50%</div> | |
<div class="bg-success p-3 w-75">Width 75%</div> | |
<div class="bg-success p-3 w-100">Width 100%</div> | |
<div class="bg-success p-3 w-auto">Width Auto</div> | |
<br> | |
<br> |
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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
NewerOlder