Skip to content

Instantly share code, notes, and snippets.

View tanish-kr's full-sized avatar
🏠
Working from home

Tatsunori Nishikori tanish-kr

🏠
Working from home
View GitHub Profile
@tanish-kr
tanish-kr / list_operation.py
Created June 20, 2017 02:29 — forked from tatsunori-nishikori/list_operation.py
Python list operation
# -*- coding: utf-8 -*-
from itertools import groupby
score = [
{ "id": 1, "name": "アリス", "class": "1-A", "score": 92 },
{ "id": 2, "name": "カレン", "class": "1-B", "score": 43 },
{ "id": 3, "name": "しの", "class": "1-A", "score": 21 },
{ "id": 4, "name": "あやや", "class": "1-A", "score": 94 },
{ "id": 5, "name": "よーこ", "class": "1-A", "score": 38 }
]
@tanish-kr
tanish-kr / genctags.sh
Created June 20, 2017 02:29 — forked from tatsunori-nishikori/genctags.sh
ctags command
#!/bin/bash
ctags -R --tag-relative --sort=yes --append=no --exclude="tmp" --exclude="cache" --exclude="test" -f .git/tags
@tanish-kr
tanish-kr / mapping.md
Created June 20, 2017 02:29 — forked from tatsunori-nishikori/mapping.md
ElasticSearchでmappingの更新

ドキュメントどおりindexでPUTしたらエラーになる

{"error":{"root_cause":[{"type":"index_already_exists_exception","reason":"already exists","index":"rettrmt"}],"type":"index_already_exists_exception","reason":"already exists","index":"rettrmt"},"status":400}

すでにあるやつはUpdate出来ないっぽい

更新したいタイプがなければ下記のようにしたら良さそう

@tanish-kr
tanish-kr / snapshot.md
Created June 20, 2017 02:28 — forked from tatsunori-nishikori/snapshot.md
ElasticSearch snapshot

1. elasticsearch.yml

# スナップショットを作成したいPathを指定する
path.repo: /usr/local/var/elasticsearch/snapshot

2. 設定読み込み

@tanish-kr
tanish-kr / recommend_engine.md
Last active June 20, 2017 09:04 — forked from tatsunori-nishikori/recommend_engine.md
レコメンドエンジン構築

レコメンドエンジン

レコメンデーションとは

ユーザに対して自動的に何らかのおすすめを提示すること。レコメンデーションを行うソフトウェアのことをレコメンドエンジンという

  • ユーザ: システムを使う人間。利用者
  • アイテム: ユーザにおすすめするもの、サービス、商品etc

Point

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@tanish-kr
tanish-kr / index.html
Created September 22, 2016 11:44 — forked from anonymous/index.html
React handson // source https://jsbin.com/yelacuyoxe
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>React handson</title>
<style id="jsbin-css">
.f-size14 {
font-size: 14px;
}