This file contains hidden or 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
/** | |
* Convert "Kana" one from another | |
* (zen-kaku, han-kaku and more) | |
* | |
* @param string str | |
* @param string option (optionaly) | |
* @return string converted string | |
*/ | |
function convert_kana (str, option) { | |
option = option || "KV"; |
This file contains hidden or 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
<?php | |
/** | |
* Replace Japanese Kana from UTF-8-MAC to UTF-8 for any env. | |
* | |
* code is generated | |
* | |
* @param string utf-8-mac string | |
* @return string utf-8 string | |
*/ |
This file contains hidden or 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
export class DurationUnit { | |
constructor(public readonly value: number, public readonly name: string) {} | |
} | |
export const nanoSecond = new DurationUnit(1, 'ns'); | |
export const microSecond = new DurationUnit(1000 * nanoSecond.value, 'µs'); | |
export const milliSecond = new DurationUnit(1000 * microSecond.value, 'ms'); | |
export const second = new DurationUnit(1000 * milliSecond.value, 's'); | |
export const minute = new DurationUnit(60 * second.value, 'm'); | |
export const hour = new DurationUnit(60 * minute.value, 'h'); |