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
brew cask install virtualbox | |
brew install docker | |
brew install boot2docker | |
boot2docker init | |
boot2docker up | |
docker run -i -t ubuntu /bin/bash |
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
boot2docker shellinit ^ /dev/null | source. |
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
i 8> u | |
To have launchd start boot2docker at login: | |
ln -sfv /usr/local/opt/boot2docker/*.plist ~/Library/LaunchAgents | |
Then to load boot2docker now: | |
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.boot2docker.plist |
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
findBalancedCurlyBrackets: function(source, startIndex, lastIndex) { | |
lastIndex = lastIndex || source.length; | |
startIndex = startIndex || 0; | |
var counter = 0; | |
var inString = false; | |
for (var index = startIndex; index < lastIndex; ++index) { | |
var character = source[index]; | |
if (inString) { | |
if (character === "\\") |
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
replace this: ((\w*)[\.\:\=\s]*function\s*(\w*)\(.*\)\s*\{) | |
with this: $1\tconsole.log\("$2$3"\);\n |
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
function test(){ | |
var a = function(){ console.log("called but ignored return"); return 7;}; | |
return a(), function(){ | |
console.log("if you do this, i hate you."); | |
return 5; | |
}(); | |
} | |
console.log(test()); | |
console.log("something"), console.log("somethingelse"); |
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
function dump(obj){ | |
while(obj!==undefined){ | |
for(var key in obj){ | |
log("j03m: " + key + " is " + obj[key].toString()); | |
} | |
try{ | |
obj = Object.getPrototypeOf(obj); | |
}catch(e){ | |
obj = undefined; | |
} |
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 MyClass = require("./classScope1.js"); | |
function setter(name, value){ | |
eval(name+"=value"); | |
} | |
MyClass.injectSetter(String(setter)); | |
MyClass.setter('fs', {}); | |
var myclass = new MyClass(); | |
myclass.go2(); |
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
//global space | |
var MockDepedency = function(){} | |
MockDepedency.prototype.getValue = function(){ | |
console.log("What what what what!!!"); | |
} | |
function __setter(name){ | |
"use strict"; |
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
# If stdin present, assume user meant cat | |
# | |
if [ ! -t 0 ] | |
then | |
cat "$@" | |
exit | |
fi | |
# Find the argument that is file/directory name and test it | |
# to find out if it is an existing directory. Other arguments are |