Skip to content

Instantly share code, notes, and snippets.

View richard-allcca's full-sized avatar
馃幆
Focusing

Thouma richard-allcca

馃幆
Focusing
View GitHub Profile
@Klerith
Klerith / seed-data.ts
Last active February 10, 2025 00:10
Informaci贸n para poblar la base de datos
import { bcryptAdapter } from '../../config';
export const seedData = {
users: [
{ name: 'Test 1', email: '[email protected]', password: bcryptAdapter.hash( '123456') },
{ name: 'Test 2', email: '[email protected]', password: bcryptAdapter.hash( '123456') },
{ name: 'Test 3', email: '[email protected]', password: bcryptAdapter.hash( '123456') },
@Klerith
Klerith / configurar-node-ts.md
Last active April 9, 2025 14:52
Node con TypeScript - TS-Node-dev simplificado

Node con TypeScript - TS-Node-dev (preferido)

  1. Instalar TypeScript y dem谩s dependencias
npm i -D typescript @types/node ts-node-dev rimraf
  1. Inicializar el archivo de configuraci贸n de TypeScript ( Se puede configurar al gusto)
npx tsc --init --outDir dist/ --rootDir src
@Klerith
Klerith / validations.ts
Created February 19, 2022 17:22
Validar email
export const isValidEmail = (email: string): boolean => {
const match = String(email)
.toLowerCase()
.match(
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
);
@jonmircha
jonmircha / helpHttp.js
Last active January 29, 2025 04:11
Script que te permite simplificar peticiones HTTP con Fetch, esta escrita en VanillaJS por lo que puedes usarla con cualquier framework o librer铆a
export const helpHttp = () => {
const customFetch = (endpoint, options) => {
const defaultHeader = {
accept: "application/json",
};
const controller = new AbortController();
options.signal = controller.signal;
options.method = options.method || "GET";
@Klerith
Klerith / estilos-basicos.css
Created December 1, 2020 19:01
Estilos b谩sicos para la introducci贸n de Angular
* {
font-family: Helvetica, Arial, sans-serif;
font-weight: 200;
}
html, body {
background: white;
margin: 20px;
color: #3e4144;
@Klerith
Klerith / react-index.html
Created May 6, 2020 19:07
Introducci贸n a React
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<!-- Cargat React -->
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>