Skip to content

Instantly share code, notes, and snippets.

#! /usr/bin/awk -f
#
# Usage:
# biome lint --colors off 2>&1 | awk
#
#
# filename
#
@wtnabe
wtnabe / gist:6cfaf15cf57faf626da58f436c4abf23
Last active August 31, 2024 05:48
JSつよつよマンに質問
  • 自分たちの書いたJSのコードのみのエラーを監視する方法は?
  • ぶっちゃけ Reactivity が嬉しいシーンてそんなに多いの?
    • 単にツールが有名で強力なものに揃っている方が採用、育成も含めて有利ってだけ?
  • VirtualDOM のデメリットは?
  • TypeScript 導入するとぶっちゃけコード書くの早くなる?遅くなる?
  • type の定義方法に決まりはある?
  • JSX って本当によい? tagged literal html`` で十分では?
  • CSS はもう素朴に custom property と簡単な Scss 程度でよくない?
  • UI の開発に本当に大事なのはツールよりユーザーのゴールと状態の設計では?
@wtnabe
wtnabe / gist:bd0cf65bce3e94302f123f38567ec0d9
Last active August 30, 2024 05:54
PlaywrightをRSpec, Capybaraと組み合わせた時のhookに関係する挙動

RSpec hooks order

  • around
  • before
  • after
  • around

Capybara session

in capybara/rspec.rb

@wtnabe
wtnabe / gist:03419571caec92d4bfb0a897c31dd15a
Last active December 3, 2023 08:52
Web Speech synthesis 上の Google Voice の制限

https://mdn.github.io/dom-examples/web-speech-api/speak-easy-synthesis/ を試す。

一定以上の長さになると途中で speak が切れる現象が発生する。

完了 OS ブラウザ Voice
failure macOS 13.6 Chrome 119 Google 日本語 ( ja-JP )
success macOS 13.6 Chrome 119 Kyoko ( ja-JP )
success macOS 13.6 Safari 17.0 Kyoko ( ja-JP )
success Android 10 Chrome 119 Google 日本語 ( ja-JP )
@wtnabe
wtnabe / glob.js
Last active October 21, 2023 22:35
globby negate behavior
import { globby } from 'globby'
const IGNORE = [
'!node_modules/**/*.*',
'!bower_components/**/*.*',
'!**/*.test.{js,ts}',
'!**/*.suite.{js,ts}',
'!**/*.config.{js,ts}',
'!**/*.d.ts',
];
@wtnabe
wtnabe / README.md
Last active September 27, 2023 11:54
StorybookでCustomElementsの情報をいい具合に出す
@wtnabe
wtnabe / javascript-pseudo-local-date-object.md
Last active August 28, 2023 02:22
JavaScript local "Date" object
@wtnabe
wtnabe / gist:eeb77935e8fd4363d10919a9ac55cf38
Last active February 21, 2024 23:22
特定の Intel Mac + macOS Ventura で rbenv + ruby-build では Ruby が install できない、できたとしてもまともに動かない問題

環境

  • MacBook Pro 16" ( Intel Core i9 )
  • macOS Ventura 13.4.1 ( Darwin Kernel Version 22.5.0 )
  • Homebrew 4.1.3
  • Apple clang version 14.0.3 (clang-1403.0.22.14.1)
  • rbenv 1.2.0
  • ruby-build 20230717
  • ruby-install 0.9.0
  • llvm 15 && 16
@wtnabe
wtnabe / svg2png.sh
Created July 8, 2023 22:18
resvgを使ってSVGからPNGを作るテンプレ
#! /bin/sh
SRC=$1
DEST=`basename ${SRC} .svg`.png
resvg --dpi 350 --zoom 2 --background '#ffffff' $SRC $DEST
@wtnabe
wtnabe / docx.sh
Last active July 8, 2023 22:25
asciidoctorとasciidoctor-diagramとpandocを使ってasciidocからdocxを作る
#! /bin/sh
asciidoctor -r asciidoctor-diagram --backend docbook --out-file - $1 | \
pandoc --from docbook --to docx --reference-doc simple-doc.docx --output `basename $1 .adoc`.docx