node ./city-search.js > result.json
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
#!/bin/bash | |
yarn init -y | |
yarn add -D typescript prettier eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-plugin-prettier | |
curl -slw "\n" https://www.gitignore.io/api/node,macos,windows,linux >> .gitignore | |
tsc --init |
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
Edge & Chrome form control collaboration | |
input要素などの刷新 | |
<meter>のグラデーションは1990sのままらしい | |
chrome://flags/#form-controls-refresh | |
windowsのHigh contrast mode | |
@media(forced-colors: active) | |
forced-color-adjust: auto | none | |
Edgeチームがform controlsの改善のために36のaccessibilityに関してのcommitをchromiumに入れた | |
Stylability |
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 asyncForEach = async <T>(array: T[], callback: (item: T, index?: number) => Promise<unknown>): Promise<void> => { | |
for (let i = 0; i < array.length; i++) { | |
await callback(array[i], i); | |
} | |
return | |
}; |
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 filesInDirectory = async (dir: DirectoryEntry): Promise<File[]> => { | |
return new Promise(async resolve => { | |
const entries = await readEntries(dir) | |
return Promise.all( | |
entries | |
.filter(e => e.name[0] !== '.') | |
.map(e => { | |
if (isDir(e)) { | |
return filesInDirectory(e) | |
} else if (isFile(e)) { |
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 readdirRecursively = async (dir, files = []) => { | |
const dirents = await fsPromises.readdir(dir, {withFileTypes: true}); | |
const dirs = []; | |
for (let dirent of dirents) { | |
if (dirent.isDirectory()) dirs.push(`${dir}/${dirent.name}`); | |
if (dirent.isFile()) files.push(`${dir}/${dirent.name}`); | |
} | |
for (let d of dirs) { | |
files = readdirRecursively(d, files) | |
} |
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
$xs-max = 575px | |
$sm-min = 576px | |
$sm-max = 767px | |
$md-min = 768px | |
$md-max = 991px | |
$lg-min = 992px | |
$lg-max = 1199px | |
$xl-min = 1200px | |
xs-screen() |
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
function onFormSubmit(event) { | |
try { | |
var itemResponses = event.response.getItemResponses(); | |
var fields = []; | |
for(var i = 0; i < itemResponses.length; i++) { | |
var itemResponse = itemResponses[i]; | |
var title = itemResponse.getItem().getTitle(); | |
var res = itemResponse.getResponse(); | |
fields.push(generateAttachmentField(title, res)); | |
} |
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 nanoid from 'nanoid'; | |
console.log(nanoid()); |
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
for(const i of document.querySelectorAll('.image-item .input-container input[name="book_id[]"]')) { | |
i.click() | |
} |
NewerOlder