Skip to content

Instantly share code, notes, and snippets.

View phatnguyenuit's full-sized avatar
💪
Working on ReactJS and TypeScript.

Phát Nguyễn (Fast) phatnguyenuit

💪
Working on ReactJS and TypeScript.
View GitHub Profile
@phatnguyenuit
phatnguyenuit / README-badges.md
Created November 30, 2020 06:49 — forked from tterb/README-badges.md
A collection of README badges

Badges

License

MIT License GPLv3 License AGPL License

Version

Version GitHub Release

@phatnguyenuit
phatnguyenuit / odoo_calculate_workers.sh
Created May 11, 2020 04:46
Analyzes the characteristics of the server and helps calculate the number of workers and memory for each
#!/bin/bash
# CONST 1GB
CONST_1GB="1024*1024*1024"
# VARIABLE WORKERS
CMD_W=0
@phatnguyenuit
phatnguyenuit / hijacking_flask_routing_for_fun_and_profit.py
Created April 15, 2020 16:50 — forked from hodgesmr/hijacking_flask_routing_for_fun_and_profit.py
Automatically register Flask routes with and without trailing slash. This way you avoid the 301 redirects and don't have to muddy up your blueprint with redundant rules.
"""Flask Blueprint sublcass that overrides `route`.
Automatically adds rules for endpoints with and without trailing slash.
"""
from flask import Blueprint, Flask
class BaseBlueprint(Blueprint):
"""The Flask Blueprint subclass."""
@phatnguyenuit
phatnguyenuit / app.py
Last active April 3, 2020 01:03 — forked from lotusirous/app.py
Example of flask blueprint and register logging to root logger
import logging
from flask import Flask
from werkzeug.utils import find_modules, import_string
def configure_logging():
# register root logging
logging.basicConfig(level=logging.DEBUG)
logging.getLogger('werkzeug').setLevel(logging.INFO)