This file contains 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
{ | |
"$schema": "https://biomejs.dev/schemas/1.9.3/schema.json", | |
"vcs": { | |
"enabled": false, | |
"clientKind": "git", | |
"useIgnoreFile": false | |
}, | |
"files": { | |
"ignoreUnknown": false, | |
"ignore": [".angular", "node_modules"] |
This file contains 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
AWS_S3_ENDPOINT_URL = f'https://{os.environ.get("BUCKET_NAMESPACE")}.compat.objectstorage.{os.environ.get("BUCKET_REGION")}.oraclecloud.com' | |
STORAGES = { | |
"default": { | |
"BACKEND": "storages.backends.s3.S3Storage", | |
"OPTIONS": { | |
"access_key": os.environ.get('BUCKET_KEY'), | |
"secret_key": os.environ.get('BUCKET_SECRET'), | |
"bucket_name": os.environ.get('BUCKET_NAME'), | |
"region_name": os.environ.get('BUCKET_REGION'), |
This file contains 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
stages: | |
- build | |
- replace | |
- deploy | |
variables: | |
SERVER: root@<server> | |
FOLDER: /PANEL/WEBSITES/<folder> | |
POSTGRES_DB: <database> | |
POSTGRES_USER: <user> |
This file contains 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 requests | |
def obtener_latitud_longitud(address): | |
# Construir la URL de la API de OpenStreetMap | |
url = f"https://nominatim.openstreetmap.org/search.php?q={address}&format=jsonv2" | |
# Realizar la solicitud GET a la API de OpenStreetMap | |
response = requests.get(url) | |
# Verificar si la solicitud fue exitosa |
This file contains 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
export DB=base | |
export PASS=pass | |
export USER=user | |
docker exec -ti mongo mongodump --username=$USER --password=$PASS --authenticationDatabase=admin --db=$DB --out /tmp/backups |
This file contains 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
"scripts": { | |
"start": "ts-node-dev src/app.ts", | |
"build": "tsc", | |
"typeorm": "typeorm-ts-node-commonjs ", | |
"t:generate": "pnpm run typeorm -d ./src/config/data-source.ts migration:generate ./src/migrations/migrate", | |
"t:migrate": "pnpm run typeorm -d ./src/config/data-source.ts migration:run", | |
"t:migrations": "pnpm run t:generate && pnpm run t:migrate", | |
"t:create-entity": "pnpm run typeorm entity:create" | |
}, |
This file contains 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
## Build angular site | |
- name: build | |
pull: if-not-exists | |
image: node:16.18.1-alpine | |
when: | |
branch: | |
- master | |
event: | |
- push | |
commands: |
This file contains 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
node_modules | |
.angular |
This file contains 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 {NextFunction, Request, Response} from "express"; | |
import Users from "../apps/users/users"; | |
export const checkToken = async (req: Request, res: Response, next: NextFunction) => { | |
const headers = req.headers; | |
if (!headers.authorization) { | |
res.status(401).json({ | |
message: "No token send!!!" | |
}) | |
return |
This file contains 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
@receiver(post_delete, sender=Image) | |
def post_save_image(sender, instance, *args, **kwargs): | |
""" Clean Old Image file """ | |
try: | |
instance.img.delete(save=False) | |
except: | |
pass |
NewerOlder