Skip to content

Instantly share code, notes, and snippets.

View chokkoyamada's full-sized avatar
🐳
✨ 😂

Naoyuki Yamada chokkoyamada

🐳
✨ 😂
View GitHub Profile
@chokkoyamada
chokkoyamada / README.md
Last active February 11, 2021 02:48 — forked from Tynael/README.md
How to use npx to run gist based scripts
@chokkoyamada
chokkoyamada / gist:40cf12308037ccb0a14c90fdef1041f5
Last active February 13, 2020 05:25
PostgreSQL コマンド

データベースのリスト

\l

テーブルのリスト

\dt

スキーマ内のテーブルリストを表示

\dt testschema.*

スキーマの表示

import itertools
n = (1, 2, 3, 4, 5, 6, 7, 8, 9)
for x in itertools.permutations(n):
bunbo1 = x[1] * 10 + x[2]
bunbo2 = x[4] * 10 + x[5]
bunbo3 = x[7] * 10 + x[8]
bunshi1 = x[0] * bunbo2 * bunbo3
bunshi2 = x[3] * bunbo1 * bunbo3
bunshi3 = x[6] * bunbo1 * bunbo2
input_list = []
while True:
pair = list(map(int, input().split(' ')))
if pair[0] == 0 and pair[1] == 0:
break
input_list.append(pair)
for pair in input_list:
h = pair[0]
w = pair[1]
PUT /_template/sample
{
"template": "sample*",
"settings": {
"analysis" : {
"analyzer" : {
"ja-ma-analyzer" : {
"type" : "custom",
"tokenizer" : "ja-ma-tokenizer"
},

Adtech Hack 2019 山田直行

やったこと

What happens when ... Kubernetes edition!の日本語訳・レビュー

https://github.com/cloud-native-lab/what-happens-when-k8s

  • 全社ゼミで「Cloud Native Expertsゼミ」で有志でやっているもの

KubernetesをMackerelで監視するMackerel Operatorを作成

@chokkoyamada
chokkoyamada / gist:a940e1087b9802d48e72ac467ff1cbf0
Created December 4, 2018 12:32
2018/12/04 Japan Container Days でのVitessについてメモ
関連Tweet
https://twitter.com/search?f=tweets&q=%23containerdaysjp%20vitess&src=typd
資料はあとでアップされると思いますが、7割ぐらい下記と同じです。Vitess のパフォーマンスと運用性を検証してみた - Speaker Deck
https://speakerdeck.com/cotoc/vitess-falsepahuomansutoyun-yong-xing-wojian-zheng-sitemita
この方が作者なのでフォローしてると追えるかと https://twitter.com/Cotoc88 
# 以下、山田のメモ
@chokkoyamada
chokkoyamada / 4_4to4_6.md
Last active May 20, 2018 12:39
scala with cats 4.4~4.6

4.4 Either

他に有用なMonadをみてみよう。Scala標準ライブラリにもあるEitherだ。 Scala2.11以前は、EitherはmapもflatMapも持っていなかったため、EitherはMonadとはいえなかった。 Scala2.12以降は、Eitherはrightに寄せる(biased)ようになったため、Monadと呼べるようになった。

4.4.1 Left and Right Bias

Scala2.11ではEitherはmapもflatMapメソッドも持っていなかった。そのためScala2.11でのEitherはfor文の中では使いづらかった。各ジェネレータの中で毎回.rightを呼ばなければならなかった。

@chokkoyamada
chokkoyamada / gist:20ccb9318b586abebf11
Created March 29, 2016 00:11
refresh_tokenからアクセストークンを取得
curl -X POST "https://namie-tablet.jp/servicemanager/__auth" -d "grant_type=refresh_token&refresh_token=RA~7ZMcxjRjYWXNq7-9731_pYPmJKqGqbyBIK-BLjjC1rjnjXAzQiEw6uLDknL-fIMn-x_6xMFj3mvC0L7reVM8YOZItL6jmHpECo6o6mSfpTc&dc_target=https://namie-tablet.jp" -H "Content-Type: application/x-www-form-urlencoded" -H "Accept:application/json" -i -k -s
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Tue, 29 Mar 2016 00:11:09 GMT
Location: https://namie-tablet.jp/__auth
Server: PCS
X-Dc-Version: 1.3.23
Content-Length: 4122
Connection: keep-alive
@chokkoyamada
chokkoyamada / gist:413f48e5fcb35760bcef
Created March 15, 2016 10:11
PIOログ @開発サーバー
2016-03-15T07:42:28.800Z [INFO ] PCS-1458027748799 client null null namie-ope zYYlEVB1Z6d5QocLvEKcD2Vn3jOIWE "s:0 ga:0 u:- d:2016/03/15 16:42:28,644 namie-ope [INFO] Start LoginView:beforeRendered"
2016-03-15T07:42:28.800Z [INFO ] PCS-1458027748800 client null null namie-ope "s:0 u:- ga:1 d:{""path"":""ope/Login"",""title"":""浪江町アプリ管理ツール/ログインページ""} "
2016-03-15T07:42:28.807Z [INFO ] PCS-1458027748807 client null null namie-ope zYYlEVB1Z6d5QocLvEKcD2Vn3jOIWE "s:0 ga:0 u:- d:2016/03/15 16:42:28,684 namie-ope [INFO] Start LoginView:app.pcsManager.ready"
2016-03-15T08:03:46.493Z [INFO ] PCS-1458029026492 client null null namie-news "s:0 u:- ga:1 d:{""path"":""news/Login"",""title"":""なみえ新聞/ログインページ""} "
2016-03-15T08:03:46.594Z [INFO ] PCS-1458029026593 client null null namie-news cnRniBW5CYNq8GCWRwHFnfsLsyKXZu "s:0 ga:0 u:- d:2016/03/15 04:01:37,973 namie-news [INFO] Start LoginView:beforeRendered"
2016-03-15T08:03:46.727Z [INFO ] PCS-1458029026726 client null null namie-news cnRniBW5CYNq8GCWRwHFnfsLsyKXZu "s:0