その他のメモ

フォントの一覧を取得

Powershell
add-type -AssemblyName system.drawing
(New-Object System.Drawing.Text.InstalledFontCollection).Families

String.fromCodePoint対応

JavaScript
if(!String.fromCodePoint){(function(){var b=(function(){try{var h={},g=Object.defineProperty,e=g(h,h,h)&&g}catch(f){}return e}()),d=String.fromCharCode,c=Math.floor,a=function(){var l=16384,h=[],k,j,g=-1,i=arguments.length;if(!i){return''}var e='';while(++g<i){var f=Number(arguments[g]);if(!isFinite(f)||f<0||f>1114111||c(f)!=f){throw RangeError('Invalid code point: '+f)}if(f<=65535){h.push(f)}else{f-=65536;k=(f>>10)+55296;j=(f%1024)+56320;h.push(k,j)}if(g+1==i||h.length>l){e+=d.apply(null,h);h.length=0}}return e};if(b){b(String,'fromCodePoint',{value:a,configurable:true,writable:true})}else{String.fromCodePoint=a}}());fcp=true;}

要素作成便利関数

JavaScript
function MakeEl (ParentEl, Tag, Text)
{
    var E = document.createElement(Tag);
    if (Text != null)
        E.appendChild(document.createTextNode(Text));
    ParentEl.appendChild(E);
    return E;
}

子ノード削除便利関数

JavaScript
function ClearChildren (Ele)
{
    while (Ele.childNodes.length > 0)
        Ele.removeChild(Ele.lastChild);
}