Skip to content

Instantly share code, notes, and snippets.

View attakei's full-sized avatar

Kazuya Takei attakei

View GitHub Profile
@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 / readme.rst
Last active July 11, 2020 07:27
Using headless-chrome for MixBox

MixBoxをヘッドレスで呼ぶ

何をするもの?

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

MixBoxは こちら

# Traial example for yandex-tank
## Usage
```bash
docker-compose run tank
```
@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')
@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 / SDLUIKitDelegate+KivyAppDelegate.h
Last active May 27, 2017 23:30
To add CrashlyticsKit for Objective-C sources created by Kivy-ios(bulldozer).
//
// SDLUIKitDelegate+KivyAppDelegate.h
//
// Created by attakei on 2014/11/05.
//
//
// modify for your SDL header's path.
#import "../src/SDL/src/video/uikit/SDL_uikitappdelegate.h"
import fire
class Calcurator(object):
def add(self, first, second):
return int(first) + int(second)
if __name__ == '__main__':
fire.Fire(Calcurator)
@attakei
attakei / kachidoki_elevator.cc
Created January 25, 2017 09:24 — forked from remore/kachidoki_elevator.cc
(1: 最適化問題) 下記パラメータのままでElevator::tick()のみを最適化して平均待ち人数を最小化する / (2: 並列化問題) 以下のプログラムをマルチスレッドで動作させると何倍早くなるか実装して検証する / (3: チューニング問題)並列化以外の方法で本プログラムの実行時間を短縮するためにどのような改修を加えるとよいか考察する
#include <iostream>
#include <iomanip>
#include <random>
#include <unistd.h>
using namespace std;
const int MAX_FLOOR = 14;
const int ELEVATOR_COUNT = 4;
const int RAISING_PROBABILITY = 10;
@attakei
attakei / once.py
Created October 25, 2016 14:10
Only once response HTTP server
#!/usr/bin/env python
from http.server import HTTPServer, SimpleHTTPRequestHandler
import signal
import sys
import os
class OnceHttpServer(HTTPServer):
def shutdown_by_signal(self, sig_num, frame):
self.server_close()
@attakei
attakei / tododemo.plug
Last active September 18, 2016 02:10
todo_demo
[Core]
Name = tododemo
Module = tododemo
[Python]
Version = 2+
[Documentation]
Description = Todo Demo