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
String.prototype.toUnicode = function(){ | |
var result = ""; | |
for(var i = 0; i < this.length; i++){ | |
result += "\\u" + ("000" + this[i].charCodeAt(0).toString(16)).substr(-4); | |
} | |
return result; | |
}; | |
"みどりいろ".toUnicode(); //"\u307f\u3069\u308a\u3044\u308d" | |
"Mi Do Ri I Ro".toUnicode(); //"\u004d\u0069\u0020\u0044\u006f\u0020\u0052\u0069\u0020\u0049\u0020\u0052\u006f" |
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 getParameterByName (name) { | |
var undefined; | |
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | |
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), | |
results = regex.exec(location.search); | |
return results === null ? undefined : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
}; |
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 isInDom(obj) { | |
var root = obj.parents('html')[0] | |
return !!(root && root === document.documentElement); | |
} | |
//if(isInDom(myElement)) { | |
// ... | |
//} |
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
gulp.task('postprocess', function () { | |
// Get Cdn Domain | |
var xml = fs.readFileSync('Web.ProductionDeploy.config', 'utf8'); | |
var xmlDoc = libxmljs.parseXml(xml); | |
var cdnDomain = xmlDoc.get("//add[@key='cdn-domain']/@value").value(); | |
console.log('cdn-domain: \'' + cdnDomain + '\''); | |
// Get App Version | |
var appVersion = require('./package.json').version; | |
console.log('version: \'' + appVersion + '\''); |
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/bash | |
for x in *.{JPG,PNG,MOV,MP4}; do | |
d=$(date -r "$x" +%Y-%m-%d) | |
mkdir -p "$d" | |
mv -- "$x" "$d/" | |
done |
NewerOlder