Skip to content

Instantly share code, notes, and snippets.

View hatappo's full-sized avatar
🐢

fumihiko hata hatappo

🐢
  • Tokyo Japan
  • 19:11 (UTC +09:00)
View GitHub Profile
@hatappo
hatappo / index.html
Last active January 18, 2024 18:50
Iconic mimimal code examples
<html>
<!-- -->
@hatappo
hatappo / how-it-works.ja.md
Created December 19, 2023 05:05
TestCafe のアーキテクチャ

どのように動作しているのか

TestCafe が登場する前は、実際のブラウザで動作するエンドツーエンドの Web テスト ツールは、これらのブラウザを外部から駆動してユーザー アクションをエミュレートすることに依存していました。ただし、このアプローチには重大な欠点がありました。

  • サードパーティ ツールへの依存。そのため、すべてのテスト環境で追加のドライバー、SDK、ライブラリをインストール、構成、保守する必要がありました。
  • ブラウザのサポートが制限されています。使用可能なブラウザとプラットフォームの範囲は、ドライバでサポートされているものに制限されていました。
  • ボイラープレート コード。 これらのテスト ツールは、テスト実行全体を通じて同じブラウザ インスタンスで機能したため、テストされた Web アプリの状態 (Cookie、ストレージなど) はテストから終了まで持続しました。テスト。その結果、エンドツーエンド テストには、テスト間の干渉を避けるために状態をクリアする大量の定型コードが含まれます。
  • 自動化が低い。 従来のツールは、テストされたページと直接対話できませんでした。ユーザーのテスト コードがアプリ コードに介入しないという事実は利点でしたが、テスト ツール自体はページ内で動作することで恩恵を受ける可能性があります。これにより、ツールで多くの日常的なタスクを自動化できるようになります。

テストカフェは違う

@hatappo
hatappo / example-playwright-scenario.js
Created December 1, 2023 15:47
ごく簡易な Playwright のテストシナリオのコード例
import { test, expect } from "@playwright/test";
test("検索ワード無しで検索した場合に急上昇ワードが表示される", async ({ page }) => {
// 1. Yahoo!Japan のサイトを開く。
await page.goto("https://www.yahoo.co.jp/");
// 2. 「検索」というラベルが付いた要素を探し出してきて、クリックする。
await page.getByRole("link", { name: "検索" }).click();
@hatappo
hatappo / index.js
Last active June 6, 2023 05:08
Kintone のアプリのデータを Zendesk のリクエスト・フォームに転送する Kintone カスタム JS のサンプル
(function () {
'use strict';
kintone.events.on(["app.record.detail.show"], event => {
const span = document.createElement('span');
const title = kintone.app.record.getFieldElement('title');
const body = kintone.app.record.getFieldElement('body');
const a = document.createElement('a');
const urlBase = 'https://*****/hc/ja/requests/new?ticket_form_id=*****';
@hatappo
hatappo / web.clj
Created May 17, 2023 18:52 — forked from prestancedesign/web.clj
Ring session authentication with Reitit
(ns authexample.web
(:gen-class)
(:require [buddy.auth :refer [authenticated? throw-unauthorized]]
[buddy.auth.backends.session :refer [session-backend]]
[buddy.auth.middleware :refer [wrap-authentication wrap-authorization]]
[clojure.java.io :as io]
[compojure.response :refer [render]]
[reitit.ring :as ring]
[ring.adapter.jetty :as jetty]
[ring.middleware.params :refer [wrap-params]]
@hatappo
hatappo / EICAR-test-virus-sample-file.txt
Created April 30, 2023 04:57
Positive test for ClamAV virus scanner.
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
@hatappo
hatappo / Gemfile
Created February 2, 2023 08:39
Parse AWS Invoice PDF file and extract the exchange rate value.
# frozen_string_literal: true
source "https://rubygems.org"
gem "pdf-reader"
@hatappo
hatappo / ReNameOfindXargs.sh
Last active November 18, 2021 16:04 — forked from 544/ReNameOfindXargs.sh
findとxargsでファイル名変更、そしてファイル名を戻す。
# カレントディレクトリ直下のマークダウンのファイルすべてに対して、ファイル名の末尾に '.org' を付与する
find ./ -type f -maxdepth 1 -name "*.md" | xargs -I% mv % %.org
# 上とまったく逆の操作。 末尾の '.org' を取り除く。
find ./ -type f -maxdepth 1 -name "*.md.ignore" | sed 's/\.ignore$//' | xargs -I% mv %.org %
# いったん、ファイル名を退避して、ことが終わったらもとに戻す、とかのときに便利。

Keybase proof

I hereby claim:

  • I am hatappo on github.
  • I am hatappo (https://keybase.io/hatappo) on keybase.
  • I have a public key whose fingerprint is 9067 C31C 8837 6D07 49C1 5AB8 8CEF A95B 3C12 2BC2

To claim this, I am signing this object:

Overview
We have heard from Amazon Chime SDK customers since our launch in 2019 that they need messaging features in their applications. Telehealth customers want to enable real-time and asynchronous communication between care providers and patients. Live event hosts want participants to discuss content in real-time over messaging while they watch a video stream. Services that host virtual trade shows want to use messaging to connect conference attendees to experts in virtual booths.
In response, we have built messaging into the Amazon Chime SDK. However, we have designed messaging in the Amazon Chime SDK to be more than just basic chat. Customers with chat use cases can create experiences that also connect communities of users through channels. Customers can create channels for scenarios that include 1-to-few members, or create channels with up to 100,000 members. Customers can also build real-time collaboration features that enable multiple users to view and update applications at the same time, using the