Skip to content

Instantly share code, notes, and snippets.

@12ange
12ange / doitlater.js
Created May 12, 2024 04:08
後でやるclass
class DoItLater{
//下のPromise解決時に呼ばれる関数 : function that will be called when the Promise is fullfilled
#func
//the Promise
#prom
get promise(){return this.#prom}
//インスタンス生成時引数
#args
@12ange
12ange / jsgf-ja-about.txt
Created June 10, 2018 20:45
WebSpeechAPIでSpeechGrammarを使って音声認識したい日本人向け JSpeech Grammer Format ざっくり日本語訳
ソースは https://www.w3.org/TR/jsgf/
【 重要 】 大まかに知りたければ、5章のサンプル集だけ見れば何となく想像がつくかも。
1章 導入部は製作には関係ないので省略。
2章 定義
2.1. 文法名やパッケージ名はJava言語と同じルールですよーみたいな。 /* つーかぶっちゃけキャメルケース変数名で大体OK */
2.2. ルール名はUnicode文字+ちょっとだけ記号も使える。なんとぉ、日本語でも大丈夫! でも<NULL>と<VOID>は予約済み。
(2.2.1-2.2.2は省略。だって文字列変数だし)
@12ange
12ange / imasparql.md
Last active May 31, 2018 05:00
im@sparql クエリメモ
@12ange
12ange / onelinrz.js
Last active May 19, 2020 11:51
便利そうな一行関数集:コピペでコンソールに入れるのも可
//imx未満の整数を返す乱数
const randS32Max = imx => (((imx|0)*Math.random())|0);
// for typescript >> const randS32Max = (imx:number) => (((imx|0)*Math.random())|0);
//各要素を関数(の返値)で初期化する
const mappedArray = (len,mfn) => Array(len).fill().map(mfn);
// for typescript >> const mappedArray = (len:number,mfn:<T>(v?:T,i?:number,a?:T[])=>T[]) => Array(len).fill(undefined).map(mfn);
/*
* 1. Array(arrayLength)は「(arrayLength)分の空スロットがある配列」を返す。