Skip to content

Instantly share code, notes, and snippets.

Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna!
([一-龯])
Regex for matching Hirgana or Katakana (*)
([ぁ-んァ-ン])
Regex for matching Non-Hirgana or Non-Katakana
([^ぁ-んァ-ン])
Regex for matching Hirgana or Katakana or basic punctuation (、。’)
@crazy4groovy
crazy4groovy / dirHtmlPageRenderToPng.js
Created July 22, 2012 15:57
PhantomJS script to loop through local directory and render HTML pages as PNG
/* tested on PhantomJS 1.6 */
var page = require('webpage').create(), loadInProgress = false, fs = require('fs');
var htmlFiles = new Array();
// console.log(fs.workingDirectory);
// console.log(phantom.args[0]);
var curdir = phantom.args[0] || fs.workingDirectory;
var curdirList = fs.list(curdir);
@rentzsch
rentzsch / gist:1216022
Created September 14, 2011 07:14
NSString* JRNSStringFromCATransform3D(CATransform3D transform)
static NSString* prettyFloat(CGFloat f) {
if (f == 0) {
return @"0";
} else if (f == 1) {
return @"1";
} else {
return [NSString stringWithFormat:@"%.3f", f];
}
}
@think49
think49 / to-hankaku.js
Created May 10, 2011 14:38
to-hankaku.js, to-zenkaku.js : 半角文字/全角文字をそれぞれ変換する
/**
* to-hankaku.js
* convert to ascii code strings.
*
* @version 1.0.1
* @author think49
* @url https://gist.github.com/964592
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
*/