- Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
- Opcional: Si usamos Fetch API en el proyecto:
version: '3.1' | |
services: | |
db: | |
image: mariadb | |
restart: always | |
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci --init-connect='SET NAMES UTF8;' --innodb-flush-log-at-trx-commit=0 | |
ports: | |
- 3306:3306 |
interface Task {
id: number;
title: string;
completed: boolean;
createdAt: Date;
}
interface CreateTaskDto extends Omit<Task, 'id' | 'createdAt'> {}
interface UpdateTaskDto extends Omit<Partial<Task>, 'id'> {}
docker run --name postgres10 -e POSTGRES_PASSWORD=postgres -v /var/data/docker-containers/postgres/v10:/var/lib/postgresql/data -p 5432:5432 -d postgres:10.21 | |
docker run --name postgres14 -e POSTGRES_PASSWORD=postgres -v /var/data/docker-containers/postgres/v14-latest:/var/lib/postgresql/data -p 5433:5432 -d postgres:latest | |
docker run --name mysql8 -e MYSQL_ROOT_PASSWORD=mysql -v /var/data/docker-containers/mysql/v8-latest:/var/lib/mysql -p 3306:3306 -d mysql:latest --character-set-server=utf8 --collation-server=utf8_unicode_ci | |
docker run -d --name mongo5 -v /var/data/docker-containers/mongo:/data/db mongo |
function uploadFile(file) { | |
var formData = new FormData(); | |
formData.append("userfile", file); | |
var request = new XMLHttpRequest(); | |
request.onload = function () { | |
if (request.status == 200) { | |
document.location.href='/'; | |
} else { | |
alert('Error! Upload failed'); | |
} |
import sys | |
import random | |
listacubos = [] | |
primos = 0 | |
repeticiones = {} | |
import math | |
def esprimo(num): | |
for n in range(2,int(num**0.5)+1): | |
if num%n==0: | |
return False |
git config --global alias.logda "log --oneline --graph --decorate --all
git config --global alias.s "status
git config --global alias.lg "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"
vim file_key | |
chmod 600 file_key | |
ssh -i file_key root@ip | |
ps -e | |
ls /etc | |
file /sbin/init | |
############################ | |
sl -Flea |
#include <LiquidCrystal.h> | |
#define ECHO 10 //Pin digital 10 para el Echo del sensor | |
#define TRIG 9 //Pin digital 9 para el Trigger del sensor | |
double tiempo = 0; | |
double distancia = 0; // | |
LiquidCrystal lcd(12,11,5,4,3,2); | |
void setup() { | |
pinMode(TRIG, OUTPUT); //pin como salida | |
pinMode(ECHO, INPUT); //pin como entrada |
if __name__ == "__main__": | |
numeroDeProcesos = int(input("Digite el numero de procesos : ")) | |
print("\n") | |
arrProcesos = [] | |
arrTemporalProcesos = [] | |
for i in range(numeroDeProcesos): | |
tiempoLlegada = int(input("Ingrese el tiempo de llegada : ")) | |
tiempoRafaga = int(input("Ingrese el tiempo de rafaga : ")) | |
print("\n") |