This file contains 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 * as Yup from "yup"; | |
test("複数のタイプに対応する", () => { | |
const schema = Yup.object({ | |
content: Yup.lazy((content) => | |
Yup.object({ | |
type: Yup.string().oneOf(["text", "textarea", "file"]).required(), | |
value: | |
content.type === "file" | |
? Yup.object({ |
This file contains 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 { useSearchParams } from "react-router-dom"; | |
export const useSetSearchParam = | |
(...[searchParams, setSearchParams]: ReturnType<typeof useSearchParams>) => | |
(key: string) => | |
(value: string) => { | |
const newSearchParams = new URLSearchParams(searchParams); | |
newSearchParams.set(key, value); | |
setSearchParams(newSearchParams); | |
}; |
This file contains 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
if [ $# -ne 3 ]; then | |
echo "usage: aws-session {profile} {serial-number} {token-code}" | |
exit 1 | |
fi | |
unset AWS_ACCESS_KEY_ID | |
unset AWS_SECRET_ACCESS_KEY | |
unset AWS_SESSION_TOKEN | |
export $(aws sts get-session-token --profile $1 --serial-number $2 --token-code $3 | jq -r '.Credentials | "AWS_ACCESS_KEY_ID=\(.AccessKeyId)", "AWS_SECRET_ACCESS_KEY=\(.SecretAccessKey)", "AWS_SESSION_TOKEN=\(.SessionToken)"') |
This file contains 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
<template> | |
<div> | |
<Example :user.sync="user"></Example> | |
<button @click.prevent="updateUser()">Save</button> | |
<button @click.prevent="revertUser()">Cancel</button> | |
{{ user }} | |
{{ userBackup }} | |
</div> | |
</template> |
This file contains 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
/bootstrap/ | |
/node_modules/ | |
/public/ | |
/vendor/ | |
composer.lock | |
package-lock.json |
This file contains 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
javascript:var%20ncode%20=%20/https:\/\/ncode.syosetu.com\/([^\/]+)/.exec(location.href)[1];%20var%20callback%20=%20(data)%20=>%20{%20%20%20if%20(data[0].allcount%20<%201)%20throw%20"no%20data";%20%20%20var%20page%20=%20Math.floor(Math.random()%20*%20data[1].general_all_no)%20+%201;%20%20%20location.href%20=%20`https://ncode.syosetu.com/${ncode}/${page}`;%20};%20%20var%20st%20=%20document.createElement("script");%20st.src%20=%20`https://api.syosetu.com/novelapi/api/?out=jsonp&callback=callback&ncode=${ncode}&of=t-n-w-s-gl-ga`;%20document.head.appendChild(st); |
This file contains 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
<?php | |
namespace components\calendar; | |
function render(array $weeks): void | |
{ ?> | |
<table class="table"> | |
<thead> | |
<tr> | |
<th>日</th> |
This file contains 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
{ | |
"eslint.autoFixOnSave": true, | |
"eslint.validate": [ | |
"javascript", | |
"javascriptreact", | |
{"language": "typescript", "autoFix": true }, | |
{"language": "typescriptreact", "autoFix": true }, | |
{"language": "vue", "autoFix": true } | |
] | |
} |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Document</title> | |
<link | |
href="https://fonts.googleapis.com/css?family=Anton|Lobster|M+PLUS+1p|Noto+Sans+JP|Noto+Serif+JP&display=swap" | |
rel="stylesheet" |
This file contains 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 { isLastDayOfMonth } = require("date-fns"); | |
const eachMonth = (ds, ms = []) => { | |
if (ds.length === 0) return ms; | |
const i = ds.findIndex(isLastDayOfMonth); | |
if (i < 0) { | |
return eachMonth([], [...ms, ds]); | |
} else { | |
return eachMonth(ds.slice(i + 1), [...ms, ds.slice(0, i + 1)]); | |
} |
NewerOlder