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.
# Traial example for yandex-tank | |
## Usage | |
```bash | |
docker-compose run tank | |
``` |
#!/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') |
[Core] | |
Name = Timer | |
Module = timer | |
[Documentation] | |
Description = Timer | |
import fire | |
class Calcurator(object): | |
def add(self, first, second): | |
return int(first) + int(second) | |
if __name__ == '__main__': | |
fire.Fire(Calcurator) |
#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; |
#!/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() |
[Core] | |
Name = tododemo | |
Module = tododemo | |
[Python] | |
Version = 2+ | |
[Documentation] | |
Description = Todo Demo |
It is tool to fetch gitignore contents from https://github.com/github/gitignore, merge fetched contents and generate local .gitignore file.
example)
$ curl https://gist.githubusercontent.com/attakei/98eb484cf013afd0d1ba/raw/f98b7ef8d87732363d2ccdb76ec9ef35151163d2/get_gitignore.py > get_gitignore