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
#!/bin/sh | |
#Runs from the existing shell (instead of creating a new copy), meaning any env variable changes will persist. | |
source ./myscript.sh | |
#OR using the . shortcut: | |
. ./myscript.sh |
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
var a = [1,2,3,4,5]; | |
//MAP | |
var mapped = a.map(function(number) { | |
return number * 2; | |
}); | |
console.log(mapped); | |
//FILTER |
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
for (var key in p) { | |
if (p.hasOwnProperty(key)) { //make sure key is part of this object, not coming from a prototype. | |
alert(key + " -> " + p[key]); | |
} | |
} |
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
<script type="text/javascript"> | |
//<![CDATA[ | |
//]]> | |
</script> |
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 service nginx restart | |
sudo service ghost restart |
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
STARTSCRIPT="run.py" | |
echo "Running script..." | |
sudo pkill -f $STARTSCRIPT | |
sudo python $STARTSCRIPT & |