Skip to content

Instantly share code, notes, and snippets.

View nicobytes's full-sized avatar
🏠
Working from home

Nicolas Molina Monroy nicobytes

🏠
Working from home
View GitHub Profile
@nicobytes
nicobytes / date-fns.md
Last active August 29, 2021 17:58
Date Fns

1. Init

const format = require('date-fns/format');
const formatDistance = require('date-fns/formatDistance');
const subDays = require('date-fns/subDays');
const sub = require('date-fns/sub');

const today = new Date();
const todayFormat = format(today, 'yyyy/MM/dd');
@nicobytes
nicobytes / guard-deactivate.md
Created August 22, 2021 20:54
guard-deactivate

1 Create Guard

ng g g guards/exit

2 Implement in Routes

const routes: Routes = [
  {
    path: 'register',
@nicobytes
nicobytes / retos.md
Last active July 19, 2021 12:13
Retos

DataSet

const watchList = [
  {
    "Title": "Inception",
    "Year": "2010",
    "Rated": "PG-13",
    "Released": "16 Jul 2010",
    "Runtime": "148 min",

Elegir el issue que quieres traducir en la board oficial ⇒ https://github.com/angular-hispano/angular/projects/2


Preparar tu entorno, para eso debes descargar el repo y luego correr pruebas unitarias y de integración para asegurar que todo este en funcionamiento antes de iniciar.

git clone your-fork
cd angular
yarn
@nicobytes
nicobytes / type-orm_nestjs.md
Last active April 3, 2024 14:08
Steps: TypeOrm + NestJs

1. Create project

npm i -g @nestjs/cli
nest new tasks-api
npm run start:dev

2. Overview and delete files

3. Create module

nest g mo tasks
const data = [1,3,4,5];
const rta = data.reduce((counter, item) => counter + item, 0);
console.log(rta);
const orders = [
{
customerName: 'Nicolas',
total: 60,
delivered: true,
},
@nicobytes
nicobytes / filter.js
Last active November 1, 2020 13:10
Filter
const orders = [
{
customerName: 'Nicolas',
total: 60,
delivered: true,
},
{
customerName: 'Zulema',
total: 120,
delivered: false,
@nicobytes
nicobytes / lighthouse-ci.yml
Created October 29, 2020 22:46
Lighthouse CI
.github/workflows/lighthouse-ci.yml
```yml
name: Lighthouse CI
on: [push]
jobs:
lhci:
name: Lighthouse CI
runs-on: ubuntu-latest
steps:
@nicobytes
nicobytes / map.js
Created October 17, 2020 12:34
MapJS
const numbers = [1,2,3,4];
// Mutable
for (let index = 0; index < numbers.length; index++) {
numbers[index] = numbers[index] + 2;
}
console.log(numbers);
// Inmutable v1
const newNumbers = [];
for (let index = 0; index < numbers.length; index++) {