Skip to content

Instantly share code, notes, and snippets.

@kudoas
kudoas / index.html
Last active November 7, 2025 01:15
できるだけHTMLとCSSを使ってフォームのリアルタイムバリデーション
<!doctype html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title></title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="/favicon.ico">
@kudoas
kudoas / cloudformation.yml
Created December 2, 2023 02:45
private-isu cloudformation
AWSTemplateFormatVersion: "2010-09-09"
Description: "private-isu Deploy"
Parameters:
KeyName:
Description: The EC2 Key Pair to allow SSH access to the instance
Type: "AWS::EC2::KeyPair::KeyName"
Resources:
# ------------------------------------------------------------#
# Network
const getCommandArgs = (): string => process.argv[2];
interface ConvertMap {
[key: string]: string;
}
const convertZenkanaToHanKana = (str: string): string => {
const ConvertMap: ConvertMap = {
ガ: "ガ",
ギ: "ギ",
@kudoas
kudoas / gem-src_config.txt
Last active June 1, 2022 13:33
gem-srcとghqを結ぶつける設定
# gem-srcのプラグインを入れる
$ git clone https://github.com/amatsuda/gem-src.git "$(rbenv root)/plugins/gem-src"
# ~/.gemrcに配置する
gemsrc_use_ghq: ~/ghq
import random
import sys
from PyPDF2 import PdfFileWriter, PdfFileReader
input = sys.argv[1]
output = sys.argv[2]
reader = PdfFileReader(input)
writer = PdfFileWriter()
pages = list(range(reader.getNumPages()))
@kudoas
kudoas / errorBoundary.tsx
Created October 7, 2020 15:04
function component, error boundary
import React from "react";
import ReactDOM from "react-dom";
import { ErrorBoundary, FallbackProps } from "react-error-boundary";
const App: React.FC = () => {
const rnd = Math.random();
if (rnd <= 0.7) {
throw new Error("Something went wrong!");
}
@kudoas
kudoas / introduction-typescript.ts
Last active June 24, 2020 01:10
TypeScriptによる型指定
// Please referd to this issue: https://qiita.com/uhyo/items/e2fdef2d3236b9bfe74a
// premitive
// hoge: 型注釈
const a: number = 2;
const b: string = "foo";
// --strinctNullChecksがオンにしない場合はnull, undefinedは他の型の値として扱える
const c: null = null;
// const d: string = c;
@kudoas
kudoas / 📊 Weekly development breakdown
Last active October 29, 2020 00:34
📊 Weekly development breakdown
TypeScript 5 hrs 21 mins ██████▏░░░░░░░░░░░░░░ 29.2%
JavaScript 4 hrs 34 mins █████▏░░░░░░░░░░░░░░░ 24.9%
Python 3 hrs 19 mins ███▊░░░░░░░░░░░░░░░░░ 18.1%
Markdown 2 hrs 5 mins ██▍░░░░░░░░░░░░░░░░░░ 11.4%
Elm 1 hr 24 mins █▌░░░░░░░░░░░░░░░░░░░ 7.7%