c4se記:さっちゃんですよ☆

.。oO(さっちゃんですよヾ(〃l _ l)ノ゙☆)

.。oO(此のblogは、主に音樂考察Programming に分類されますよ。ヾ(〃l _ l)ノ゙♬♪♡)

音樂は SoundCloud に公開中です。

考察は現在は主に Scrapbox で公表中です。

Programming は GitHub で開發中です。

TypeScript

JavaScript / TypeScript で grep しにくい對象を、ESLint plugin を作って抽象構文木を基に檢索する

JavaScript / TypeScript で grep しにくい對象を抽象構文木を基に ESLint plugin で檢索する方法を敎へてもらった。目標とする抽象構文木で error を出す ESLint plugin を書けば、行が分かれて grep / ag しづらい對象を網羅して檢索できる。 今調べるとそ…

react-swipeable と react-transition-group で swipe animation

以下のおもちゃ React component が有って、右に swipe したら右に fade out、左に swipe したら左に fade out したいとしよう。 import React, { useState } from "react"; const items = [ {id: 1, content: "item 1"}, {id: 2, content: "item 2"}, ]; ex…

JavaScript で、文字列を UTF-8 にした時の byte 數を計算する

Ruby irb> '冬'.bytes.map{ |n| n.to_s(16) } => ["f0", "af", "a0", "9a"] irb> '冬'.bytesize => 4 irb> '羽󠄀'.bytes.map{ |n| n.to_s(16) } => ["e7", "be", "bd", "f3", "a0", "84", "80"] irb> '羽󠄀'.bytesize => 7 冬の正字冬は"\u{2f81a}"で 4 byte、…