既存システムの実装を「事実上の仕様」とみなし、それを形式化することで 「テストでは踏めないバグ」と「実装が暗黙に決めている仕様」を炙り出すための手順書。 仕様書が無い / あてにならない / 仕様と実装がずれている、という現場を前提にする。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WITH teams AS ( | |
| SELECT 1 AS id | |
| , 'yancya-club' AS name) | |
| , members AS ( | |
| SELECT 1 AS id | |
| , 'yancya' AS name | |
| , 1 AS team_id) | |
| SELECT * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int add(int x, int y){ | |
| return x + y * 2; | |
| } |
PostgreSQLなどの既存のRDBMSはスキーマを持つ。スキーマがあることは良いことだが、このスキーマのライフサイクルはアプリケーションコードのライフサイクルと乖離しがちで、結果として以下のような問題が発生する。
- 特に自動化をしない場合はマイグレーションをデプロイとは別に行う必要が発生する。これにより、
- シンプルに作業が面倒。
- 承認フローが追加で必要になる。または、デプロイはレビューの管理下に置かれているのにマイグレーション側が適切に管理されないなどのミスマッチが起きる。
- マイグレーション忘れ、マイグレーションのリバート忘れのリスクがある。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { Worker, isMainThread, workerData, parentPort } = require('worker_threads') | |
| if (isMainThread) { | |
| class AsyncRex { | |
| constructor (pattern, flags) { | |
| if (pattern instanceof RegExp) { | |
| this.source = pattern.source | |
| this.flags = pattern.flags | |
| } else if (typeof pattern === 'string') { | |
| this.source = pattern |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Hono } from 'hono' | |
| const slurpAsset = async (rawPath) => { | |
| let ASSET_MANIFEST = __STATIC_CONTENT_MANIFEST | |
| if (typeof __STATIC_CONTENT_MANIFEST === 'string') { | |
| ASSET_MANIFEST = JSON.parse(__STATIC_CONTENT_MANIFEST) | |
| } | |
| let ASSET_NAMESPACE = __STATIC_CONTENT | |
| const key = ASSET_MANIFEST[rawPath] || rawPath | |
| const template = await ASSET_NAMESPACE.get(key, { type: 'text' }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ts, { factory } from "typescript"; | |
| export function transformerFactory(context: ts.TransformationContext) { | |
| function visitNode(node: ts.Node): ts.Node { | |
| const newNode = ts.visitEachChild(node, visitNode, context); | |
| if ( | |
| ts.isJsxOpeningElement(newNode) || | |
| ts.isJsxSelfClosingElement(newNode) | |
| ) { | |
| return appendSourceMapAttribute(newNode.getSourceFile(), newNode); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Alias /.well-known/acme-challenge/ /var/www/acme/.well-known/acme-challenge/ | |
| <Directory /var/www/acme/.well-known/acme-challenge> | |
| Require all granted | |
| </Directory> | |
| <VirtualHost 127.0.0.1:80> | |
| <IfModule status_module> | |
| <Location /server-status> | |
| Require ip 127.0.0.1 ::1 | |
| SetHandler server-status |
NewerOlder