Skip to content

Instantly share code, notes, and snippets.

六幻 lonfee88

Block or report user

Report or block lonfee88

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View dom2html.js
function nodeToString ( node ) {
var tmpNode = document.createElement( "div" );
tmpNode.appendChild( node.cloneNode( true ) );
var str = tmpNode.innerHTML;
tmpNode = node = null; // prevent memory leaks in IE
return str;
}
//http://stackoverflow.com/questions/4239587/create-string-from-htmldivelement
@lonfee88
lonfee88 / test_glob.js
Last active Aug 29, 2015
node path.sep
View test_glob.js
var glob = require('glob');
var path = require('path');
var sep = process.platform != 'win32' ? '\\' : '/';
console.log(sep);
var patterns = ['**/*.js', '**\\*.js'];
patterns.map(function(pattern){
var tmp = pattern.split(sep).join(path.sep);
console.log(pattern);
console.log(tmp);
You can’t perform that action at this time.