Skip to content

Instantly share code, notes, and snippets.

View koh110's full-sized avatar

Kohta Ito koh110

View GitHub Profile

配列のメモリ使用量確認

$ node memory_new_array.js 
[
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
const settings = {
index: { max_ngram_diff: 2 },
analysis: {
tokenizer: {
kuromoji_tokenizer: {
type: 'kuromoji_tokenizer',
mode: 'search'
},
unigram_tokenizer: {
type: 'ngram',
@koh110
koh110 / README.md
Last active June 13, 2020 18:11
Elasticsearch
# index 確認
$ curl -X GET 'localhost:9200/_cat/indices?v'

$ curl -X DELETE 'localhost:9200/index-rooms-v1?pretty'

$ curl -X POST -H 'Content-Type: application/json' 'http://localhost:9200/rooms/_analyze?pretty' -d '{"analyzer": "ngram", "text": "general"}'

$ curl -X POST -H 'Content-Type: application/json' "http://localhost:9200/rooms/_search?pretty=true" -d '
{
@koh110
koh110 / vmware.md
Last active July 22, 2022 08:24
VMware
@koh110
koh110 / exec.md
Created November 21, 2019 10:50
promiseラップするとどれくらい遅くなるか
$ node -v
v12.12.0

$ node promise.js
pure: 4.863ms
promise: 47.649ms
const moment = require('moment')
const dayjs = require('dayjs')
const { format } = require('date-fns')
const limit = 10000
const date = new Date()
console.time('intl')
for (let i = 0; i < limit; i++) {