Skip to content

Instantly share code, notes, and snippets.

View attakei's full-sized avatar

Kazuya Takei attakei

View GitHub Profile
@attakei
attakei / timer.plug
Last active September 6, 2017 10:19
Timer demo for errbot
[Core]
Name = Timer
Module = timer
[Documentation]
Description = Timer
@attakei
attakei / checkout_all_branches.py
Created December 30, 2017 01:17
Checkout all branches from 'origin'
#!/usr/bin/env python
"""Generated by act as 2017-12-30 09:57:20.386358
"""
import sys
import logging
from pathlib import Path
from git import Repo
Logger = logging.getLogger('checkout_all_branches')
# Traial example for yandex-tank
## Usage
```bash
docker-compose run tank
```
@attakei
attakei / readme.rst
Last active July 11, 2020 07:27
Using headless-chrome for MixBox

MixBoxをヘッドレスで呼ぶ

何をするもの?

7/10にバンダイナムコアーツがリリースした、サービスMixBoxをヘッドレスモードのGoogleChromeで呼びます。 再生開始まで行い、それ以上のことはしません。

MixBoxは こちら

@attakei
attakei / case-1-no-config.md
Last active September 16, 2020 16:54
gunicorn edit header before passing wsgi

Run server

$ gunicorn main:app

Request/Response

No header

@attakei
attakei / python_google_home_notify_ja.md
Last active November 23, 2020 13:56
Google home notifications by python

Pythonを使ってGoogle Homeに指定したテキストを喋らせる

使い方

  1. これをcloneする
  2. virtualenvを用意する
  3. pip install -r requirements.txtで依存パッケージをインストールする
  4. python server.pyでサーバーを起動する
  5. ブラウザで、サーバーにアクセスして、フォームにテキストと言語を指定して「喋る」ボタンを押す
  6. Google Homeが喋った!
@attakei
attakei / conf.py
Last active February 28, 2021 07:15
.readme.md
project = 'sphinx-revealjs-issue'
copyright = '2021, Kazuya Takei'
author = 'Kazuya Takei'
release = '2021.2.28'
extensions = [
'sphinx.ext.todo',
'sphinx_revealjs',
]
templates_path = ['_templates']

FastAPI Middleware to forwarding hostname

Overview

FastAPI middleware to override Host header value by X-Forwarded-Host header value if it is exists.

FastAPI(Starlette) can make response used by X-Forwarded-Host header for slash-tailed redirection.

@attakei
attakei / commit-msg
Created December 4, 2021 08:21
Git commit-msg hook for Conventional Commits
#!/usr/bin/env python
import re
import sys
from pathlib import Path
VALID_TYPES = [
# Rule 1 and 2.
"feat", "fix",
# Rule 4.(Optional)
@attakei
attakei / PKGBUILD
Created December 18, 2021 08:28
Install gh(GitHub CLI) fy pacman likely AUR
# Maintainer: Your Name <youremail@domain.com>
pkgname=gh-bin
pkgver=2.3.0
pkgrel=1
epoch=
pkgdesc="GitHub’s official command line tool (private AUR for install from binary)"
arch=('x86_64')
url="https://github.com/cli/cli/tree/v2.3.0"
license=('MIT')
groups=()