Skip to content

Instantly share code, notes, and snippets.


Harry Huang hyharryhuang

View GitHub Profile
#Runs from the existing shell (instead of creating a new copy), meaning any env variable changes will persist.
source ./
#OR using the . shortcut:
. ./
hyharryhuang / mapFilterReduce.js
Created Jan 22, 2015
Javascript Map, Filter, Reduce Usage
View mapFilterReduce.js
var a = [1,2,3,4,5];
var mapped = {
return number * 2;
hyharryhuang / IterateExample.js
Created Jan 12, 2015
Iterate through javascript Objects
View IterateExample.js
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]);
hyharryhuang / ScriptTagAvoidProblems.htm
Created Jan 1, 2015
Avoiding problems with embedded < in scripts
View ScriptTagAvoidProblems.htm
<script type="text/javascript">
sudo service nginx restart
sudo service ghost restart
hyharryhuang /
Last active Aug 29, 2015
Easy Kill and Rerun Python Wrapper
echo "Running script..."
sudo pkill -f $STARTSCRIPT
sudo python $STARTSCRIPT &