This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| import settings | |
| logger = logging.getLogger(settings.APP_NAME) | |
| formatter = logging.Formatter( | |
| "%(asctime)s - %(levelname)s - %(filename)s:%(lineno)d - %(message)s" | |
| ) | |
| for item in settings.LOGGERS: | |
| level, filename = item.split(":", 1) | |
| if filename in ("stdout", "stderr"): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # docker-compose.yml | |
| version: '3.3' | |
| services: | |
| php: | |
| # image: php:7.4-apache | |
| build: | |
| context: . | |
| dockerfile: php.Dockerfile | |
| container_name: pcge | |
| ports: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| notebook-home |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # cd somewhere | |
| git clone https://github.com/ali96343/unbundler.git | |
| cp unbundler/unbun ~/.local/bin/ | |
| chmod ug+x ~/.local/bin/unbun | |
| su - $USER # It seams it's necessary to make the unbun command recognized | |
| # cd somewhere | |
| py4web setup apps | |
| cp -a apps/_scaffold apps/vlbd | |
| mkdir apps/vlbd/static/tte | |
| git clone https://github.com/manuelep/vue-light-bootstrap-dashboard.git apps/vlbd/static/tte/vue-light-bootstrap-dashboard |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "result": [ | |
| { | |
| "bg_img": "https://loremflickr.com/560/420/furniture,estate?random=5", | |
| "geometry": { | |
| "coordinates": [ | |
| 12.3856, | |
| 44.2011 | |
| ], | |
| "type": "Point" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| from pydal.validators import Validator, IS_MATCH, ValidationError | |
| class IS_NOT(Validator): | |
| """ A not validatro is like a not joke... NOT! """ | |
| def __init__(self, validator, *args, error_message="Invalid expression", **kwargs): | |
| super(IS_NOT, self).__init__() | |
| self.__validator = validator(*args, **kwargs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var LAYERSWITCHERINPUTNAME = 'overlays' | |
| function getLeafletRadio (value, label, icon, checked) { | |
| let lab = document.createElement('label'); | |
| let el = document.createElement('div'); | |
| lab.appendChild(el); | |
| let input = document.createElement('input'); | |
| input.classList.add('leaflet-control-layers-selector'); | |
| input.setAttribute('type', 'radio'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a[disabled], a[disabled]:hover { | |
| pointer-events: none; | |
| cursor: default; | |
| /* display: none; */ | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .legend-item { | |
| /* padding: 6px 8px; */ | |
| font: 18px/20px Arial, Helvetica, sans-serif; | |
| /* background: white; */ | |
| /* background: rgba(255,255,255,0.5); */ | |
| /* box-shadow: 0 0 15px rgba(0,0,0,0.2); */ | |
| border-radius: 10px; | |
| margin: .5em .5em .5em .5em; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import itertools | |
| from more_itertools import powerset | |
| def all_possible_multivalue(*values): | |
| values_ = list(itertools.permutations(values)) | |
| values = list(set(sum([list(powerset(vv)) for vv in values_], []))) | |
| return values | |
| print(sorted(all_possible_multivalue(1,2,3,), key=lambda v: (len(v), v,))) | |
| # [(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 1), (2, 3), (3, 1), (3, 2), (1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1)] |