Skip to content

Instantly share code, notes, and snippets.

function mkdir_if_not_exist(dirpath)
if dirpath(end) ~= '/', dirpath = [dirpath '/']; end
if (exist(dirpath, 'dir') == 0), mkdir(dirpath); end
end
@wiennat
wiennat / ExampleOfObject.js
Created August 3, 2012 08:30 — forked from punneng/ExampleOfPrivateMemberDeclaring.js
How to declare private properties/methods
function myPowerConstructor(x) {
var that = otherMaker(x);
var secret = f(x);
that.priv = function () {
... secret x that ...
};
return that;
}
@wiennat
wiennat / ExampleOfObject.js
Created August 3, 2012 08:29 — forked from punneng/ExampleOfPrivateMemberDeclaring.js
How to declare private properties/methods
function myPowerConstructor(x) {
var that = otherMaker(x);
var secret = f(x);
that.priv = function () {
... secret x that ...
};
return that;
}