Skip to content

Instantly share code, notes, and snippets.

View onimenotsuki's full-sized avatar
🎯
Focusing

Edgar Talledos Robledos onimenotsuki

🎯
Focusing
View GitHub Profile
@onimenotsuki
onimenotsuki / download-file.js
Created June 27, 2023 15:58
Download file with pupeteer
import puppeteer from 'puppeteer';
import path from 'path';
(async () => {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
const client = await page.target().createCDPSession();
#Comillas simples
cads = 'Texto entre comillas simples'
#Comillas doble
cadd = "Texto entre comillas"
print(type(cads))
const Person = require('../../src/api/models/person');
const dbHandler = require('../db-handler');
// Connect to a new in-memory database before running any test
beforeAll(async () => await dbHandler.connect());
// Clear all test data after every test
afterEach(async () => await dbHandler.clearDatabase());
// Remove and close the db and server
@onimenotsuki
onimenotsuki / .gitignore
Created January 22, 2021 01:25
Gitignore para proyectos con nodejs y vscode
# Created by https://www.toptal.com/developers/gitignore/api/node,vscode
# Edit at https://www.toptal.com/developers/gitignore?templates=node,vscodes
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
@onimenotsuki
onimenotsuki / login.js
Created March 17, 2020 06:20
Tutorial: Parte 1: Autenticación por medio de API con JWT, ExpressJS, ReactJS y React Native -> Inicio de sesión
// Cargamos nuestros módulos
const Bcrypt = require('bcrypt');
const jwt = require('jsonwebtoken');
// Añadimos dotenv para utilizar las variables de entorno
const dotenv = require('dotenv');
// Cargamos nuestro modelo
const User = require('../../models/user');
// Cargamos nuestras variables de entorno
@onimenotsuki
onimenotsuki / signup.js
Created March 17, 2020 05:38
Tutorial: Parte 1: Autenticación por medio de API con JWT, ExpressJS, ReactJS y React Native -> Registro de usuarios
// Cargamos nuestros módulos
const Bcrypt = require('bcrypt');
const jwt = require('jsonwebtoken');
// Añadimos dotenv para utilizar las variables de entorno
const dotenv = require('dotenv');
// Cargamos nuestro modelo
const User = require('../../models/user');
// Cargamos nuestras variables de entorno
@onimenotsuki
onimenotsuki / user.js
Created March 17, 2020 05:01
Tutorial: Parte 1: Autenticación por medio de API con JWT, ExpressJS, ReactJS y React Native -> User Model
const mongoose = require('mongoose');
const validator = require('validator');
const Schema = mongoose.Schema;
const UserSchema = new Schema(
{
username: {
type: String,
required: true,
unique: true,
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using EasyAR;
/* This script fixes the model shake behavior on EasyAr v2. You should
use this instead of ImageTargetBehaviour on your target. Just delete the
ImageTargetBehaviour component and add this one
It is a fixed and improved version of the one posted on this thread:
@onimenotsuki
onimenotsuki / .eslintrc.js
Created December 21, 2019 21:50
Cofiguracióones default para proyectos de Tech Talent
module.exports = {
extends: ['airbnb', 'prettier'],
plugins: ['prettier'],
rules: {
'import/no-extraneous-dependencies': 0,
// Admit use of console.log and derivates in app
'no-console': 0,
'prettier/prettier': 'error',
},
globals: {
@onimenotsuki
onimenotsuki / layout.jsx
Created August 2, 2019 18:30
Layout inicial para remover margen con emotion
/**
* Layout component that queries for data
* with Gatsby's useStaticQuery component
*
* See: https://www.gatsbyjs.org/docs/use-static-query/
*/
import React from 'react';
import PropTypes from 'prop-types';
import { useStaticQuery, graphql } from 'gatsby';