Skip to content

Instantly share code, notes, and snippets.

View yuokada's full-sized avatar

Yukihiro Okada (Yuki) yuokada

  • Tokyo, Japan
  • 05:53 (UTC +09:00)
View GitHub Profile
{
"data": [
{
"country_code": "AF",
"country_name": "Afghanistan",
"dialling_code": "+93"
},
{
"country_code": "AL",
"country_name": "Albania",
@yuokada
yuokada / MiniParser.scala
Created September 7, 2021 07:58 — forked from kishida/MiniParser.scala
Mini parser with parser combinators of scala.
package miniparser
import scala.util.parsing.combinator.RegexParsers
import scala.collection.mutable.Map
object Main {
def main(args: Array[String]): Unit = {
val expr = """
def mod(x, y) ={
@yuokada
yuokada / bash_strict_mode.md
Created May 26, 2021 08:03 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation

set -e, -u, -o, -x pipefail

The set lines

  • These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing.
  • With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
  • set -euxo pipefail is short for:
set -e
set -u
@yuokada
yuokada / convert.py
Last active May 22, 2018 16:26 — forked from foomin10/seiyuu_jisyo.tsv.txt
声優名の辞書ファイル。<http://tomoch.s28.xrea.com/ime.cgi> からコピーして自分の知ってる人だけ大雑把に抽出。
#!/usr/bin/env python3.6
import jaconv
if __name__ == '__main__':
filename = 'ime.cgi'
with open(filename, 'r') as f:
for ln in f.readlines():
parts = ln.strip().split()
kana = jaconv.hira2kata(parts[0])
@yuokada
yuokada / RESTAPI.md
Created March 15, 2017 11:09 — forked from descico/presto-code-split.md
Presto の話。ただし最近ほとんど触っていなかったので情報は古いので注意せよ。

REST API

curl -H "X-Presto-Schema:default" -H "X-Presto-Catalog:hive" -H "X-Presto-User:bob" -d "select count(*) from users" http://presto-coordinator:8080/v1/statement
  • 以下の手順で使うことになる
  1. クエリを /v1/statement に POST する
  2. レスポンスの nextUri を見る。終わっていればここに結果が入る。
  3. 2.のレスポンスの nextUri を見る。これをやると 1. の nextUri は見れなくなる。
@yuokada
yuokada / example.toml
Created May 8, 2016 06:33 — forked from mzgoddard/example.toml
TOML Grammers
# A TOML example. Unlike JSON it supports comments.
[player]
particles = [
[ 0.0, -5.0 ],
[ 4.330127018922194, -2.4999999999999996 ],
[ -4.330127018922194, -2.4999999999999996 ]
]
# Unlike YAML, there is only one way to write arrays.
# There is only one way to write tables too.
# This reduces implementation complexity for a TOML parser.
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)

GitHub Flow

31 Aug 2011

git-flowの問題点 (Issues with git-flow)

私は人々にGitを教えるためにあちこちを飛び回っているが、最近のほぼすべてのクラスやワークショップで git-flow についてどう思うかを尋ねられた。私はいつも、git-flowは素晴らしいと思うと答えている。何百万ものワークフローを持ったシステム(Git)を提供し、ドキュメントもあるし、よくテストされている。フレキシブルなワークフローは、実に容易なやり方で多くの開発者の役に立つ。標準的なものになりつつあり、開発者はプロジェクトや企業の間を移動しつつこの標準的なワークフローに馴染むことができる。

@yuokada
yuokada / Go.md
Created August 24, 2013 06:55 — forked from mogeta/Go.md

Go弱向け資料。

この資料はGo弱の会向けに作成中の資料です。 Go強の方がいらっしゃいましたら補足とかもらえると助かります。