Mongo dump bash
download all db with gzip mongo backup and delete backups old 10 days before
#!/bin/bash
BACKUP_DIR="$HOME/Backup/my-site"
DATE=$(date +"%Y%m%d")
BACKUP_FILE="$BACKUP_DIR/my-site_$DATE.gz"
DAYS_TO_KEEP=10
download all db with gzip mongo backup and delete backups old 10 days before
#!/bin/bash
BACKUP_DIR="$HOME/Backup/my-site"
DATE=$(date +"%Y%m%d")
BACKUP_FILE="$BACKUP_DIR/my-site_$DATE.gz"
DAYS_TO_KEEP=10
the part of code is express
app.get("/video", (req, res) => {
// indicates the part of a document that the server should return
// on this measure in bytes for example: range = 0-6 bytes.
const range = req.headers.range;
if (!range) res.status(400).send("Range must be provided");
import { useEffect, useRef } from 'react';
import axios, { AxiosError, AxiosRequestConfig } from 'axios';
import _useAxios, { configure } from 'axios-hooks';
import { useErrorHandler } from 'react-error-boundary';
import { useToast } from '@chakra-ui/react';
import { API_URL } from '../config';
Json file from countries and iso and dial data for users register.
$file = file_get_contents(dirname(__FILE__)."/countries.json");
$json = json_decode($file, true);
var_dump($json);
Funciones globales para ejecutar pruebas describe(name, cb)
te permite agrupar varios test unitarios
y dentro podemos usar it(name, cb)
o test(name, cb)
para acceder a un elemento screen
y para debugear screen.debug()
usamos render
de @testing-library/react
para pintar y evaluar el componente.
para acceder al dom del componente usamos screen
y buscar elementos con getBy...
y con promise findBy...
los objetos y funciones mas usados
servicio text que permite acceder al tipo de cambio de la sunat de una manera mas simple:
## | |
# I wanted to use same ssl client certificate CA in nginx for multple client certs | |
# but restrict the users outside our organisation accessing everything. | |
# Because I can decide what to put into the emailAddress I can force verify everything and only pass the proper users. | |
## | |
## | |
# This way you can restrict users only with email addresses from @koodimonni.fi | |
# Put this into http context in nginx configs | |
## |
[1,2,3,4].reduce( (acc,current) => acc+current , 0); // result => 10
[
{item: 10},
server {
listen 80;
server_name site.dev;
add_header 'Access-Control-Allow-Credentials' 'true';
location / {
proxy_pass http://127.0.0.1:3001/;
}