object から 特定のobjectの一部を除外する
export function omit<T extends Record<string, unknown>>(
object: T,
keys: Array<keyof T>
) {
return Object.fromEntries(
Object.entries(object).filter(([key, _]) => !keys.includes(key))
);
object から 特定のobjectの一部を除外する
export function omit<T extends Record<string, unknown>>(
object: T,
keys: Array<keyof T>
) {
return Object.fromEntries(
Object.entries(object).filter(([key, _]) => !keys.includes(key))
);
set fenc=utf-8 | |
set nobackup | |
set noswapfile | |
set autoread | |
set hidden | |
set showcmd | |
set number | |
set cursorline |
<!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"> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" | |
crossorigin="anonymous"> | |
<script src="https://www.gstatic.com/firebasejs/4.12.1/firebase.js"></script> |
service: demo-kotlin-serverless | |
provider: | |
name: aws | |
runtime: java8 | |
stage: dev | |
region: ap-northeast-1 | |
package: | |
artifact: build/distributions/demo-0.0.1-SNAPSHOT.zip |
const fs = require("fs"); | |
const readline = require("readline"); | |
const stream = fs.createReadStream("./data/out1.txt", "utf8"); | |
const reader = readline.createInterface({ | |
input: stream | |
}); | |
const writeFile = (path, data) => { | |
fs.writeFile(path, data, err => { |
const axios = require('axios'); | |
const res = { | |
statusCode: 200, | |
body: [] | |
} | |
const httpList = [ | |
'https://transitlist.herokuapp.com/', | |
'https://www.google.co.jp', |
const puppeteer = require('puppeteer'); | |
(async() => { | |
const proxyUrl = 'http://proxy.example.com:8000'; | |
const username = 'bob'; | |
const password = 'password123'; | |
const browser = await puppeteer.launch({ | |
args: [`--proxy-server=${proxyUrl}`], | |
headless: false, |
// 非推奨 | |
// const round = (num, decimalPoint) => Math.round(num * Math.pow(10, decimalPoint)) / Math.pow(10, decimalPoint); | |
const round = (num, decimalPoint) => Math.round(num * 10 ** decimalPoint) / 10 ** decimalPoint; | |
console.log(round(12.335, 2)); // => 12.34 |
const aws = require('aws-sdk'); | |
aws.config.region = 'us-east-1'; | |
const s3 = new aws.S3(); | |
const paramsToGet = { | |
Bucket: 'bucketname', | |
Key: 'dir/file.json' | |
}; | |
const paramsToPut = body => { |
const fs = require('fs'); | |
const json = JSON.parse(fs.readFileSync('./a.json', 'utf8')); | |
for (let o of json) { | |
for (let [key, value] of Object.entries(o)) { | |
console.log({ key, value }); | |
} | |
} |