Fixing active-oulet's bckoCmer not overrided when main-merchant's bckoCmer revised
bcko cmer milik outlet tidak mengikuti parent saat outlet di-approve terlebih dahulu sebelum parent, dan parent dilakukan revisi bcko cmer.
getTierMdr() │ ├── isOnUs? (cek 8 digit pertama MPAN) │ ├── [mdrTierEnabled && H0 && UMI?] │ ├── YA → Cari tier berdasarkan amount │ │ ├── Ketemu → pakai (isOnUs? mdrOnUs : mdrOffUs) dari TIER │ │ └── Tidak → fallback ke (isOnUs? mdrOnUs : mdrOffUs) dari ACCOUNT │ └── TIDAK → pakai (isOnUs? mdrOnUs : mdrOffUs) dari ACCOUNT
| defaults write com.apple.WindowManager AutoHideDelay -int 0 | |
| defaults write com.apple.dock autohide-time-modifier -int 0; killall Dock |
| def generatePathsFromDictBasedPaths(d: dict, **kwargs): | |
| """ | |
| the point is just adding prefix to each key, | |
| then call self function to proccess nested dict. | |
| example: | |
| ``` | |
| { | |
| "dashboard": {}, | |
| "help": {}, |
| from uvicorn.config import LOGGING_CONFIG | |
| import logging | |
| # custom logging | |
| LOGGING_CONFIG["loggers"]["uvicorn.custom"] = { | |
| "handlers": ["custom"], | |
| "level": "INFO", | |
| "propagate": False | |
| } | |
| LOGGING_CONFIG["handlers"]["custom"] = { |
| import uvicorn | |
| from uvicorn.config import LOGGING_CONFIG | |
| # default uvicorn format | |
| LOGGING_CONFIG["formatters"]["default"]["fmt"] = "%(asctime)s %(levelprefix)s %(message)s" | |
| LOGGING_CONFIG["formatters"]["default"]["datefmt"] = "%Y-%m-%d %H:%M:%S" | |
| # api call format | |
| LOGGING_CONFIG["formatters"]["access"]["fmt"] = '%(asctime)s %(levelprefix)s %(client_addr)s - "%(request_line)s" %(status_code)s' | |
| LOGGING_CONFIG["formatters"]["access"]["datefmt"] = "%Y-%m-%d %H:%M:%S" |
| function renderPostsCallback(pages_total = 1, current_page = 1, has_previous = false, has_next = false) { | |
| /* control frontend pagination */ | |
| let max = 5 | |
| if (pages_total < 5) { | |
| max = pages_total | |
| } | |
| let max_left = 2 | |
| if (current_page<3) { | |
| max_left = current_page-1 | |
| } |
| import threading | |
| from typing import TypeVar, Generic, Callable, Any | |
| T = TypeVar("T") | |
| class ThreadWithResult(threading.Thread, Generic[T]): | |
| # "https://stackoverflow.com/a/65447493/17881894" | |
| """ |
python manage.py dumpdata > dbdump.json
migrate command to set up the new database *if the new database does not have same model (tables), as when creating new database
python manage.py migrate
| import logging | |
| # set config in main file | |
| logging.basicConfig( | |
| level=logging.INFO, | |
| format='%(asctime)s %(levelname)s\t| %(message)s', | |
| datefmt='%d/%m/%Y %H:%M:%S', | |
| ) | |
| # create logger instead using logging directly |