This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Injectable } from "@nestjs/common"; | |
| import { ConfigService } from "@nestjs/config"; | |
| import jwt from "jsonwebtoken"; | |
| @Injectable() | |
| export class JwtProvider { | |
| constructor(private configService: ConfigService) {} | |
| sign(payload: string) { | |
| return jwt.sign(payload, this.configService.get<string>("JWT_SECRET")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to Github pages | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build-deploy: | |
| runs-on: ubuntu-latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| new Intl.NumberFormat('es-CL', { | |
| style: 'currency', | |
| currency: 'CLP', | |
| }).format(1500); | |
| // https://medium.com/geekculture/automatic-number-format-with-javascript-all-countries-8b457ac0b491 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Django settings for school_service project. | |
| Generated by 'django-admin startproject' using Django 3.1. | |
| For more information on this file, see | |
| https://docs.djangoproject.com/en/3.1/topics/settings/ | |
| For the full list of settings and their values, see | |
| https://docs.djangoproject.com/en/3.1/ref/settings/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Injectable } from '@nestjs/common'; | |
| import { ConfigService } from '@nestjs/config'; | |
| import AWS from 'aws-sdk'; | |
| @Injectable() | |
| export class S3Provider { | |
| private s3: AWS.S3; | |
| private bucket: string; | |
| private folder: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const sgMail = require('@sendgrid/mail'); | |
| sgMail.setApiKey(process.env.SENDGRID_API_KEY); | |
| const msg = { | |
| to: "test@example.com", | |
| from: 'test@example.com', | |
| subject: 'Sending with SendGrid is Fun', | |
| text: 'and easy to do anywhere, even with Node.js', | |
| html: '<strong>and easy to do anywhere, even with Node.js</strong>', | |
| }; | |
| sgMail.send(msg); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Orders collection | |
| { | |
| "_id" : ObjectId("634312b873d381100e27b8ea"), | |
| "company" : "Microsoft", | |
| "products" : [ | |
| ObjectId("634312f073d381100e27b8ec"), | |
| ObjectId("634312f073d381100e27b8ed") | |
| ] | |
| }, | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Authors Collection | |
| { | |
| "_id" : ObjectId("63430b9e73d381100e27b8e9"), | |
| "name" : "J. K. Rowling", | |
| "books" : [ | |
| ObjectId("63430b8a73d381100e27b8e7"), | |
| ObjectId("63430b8a73d381100e27b8e8") | |
| ] | |
| } | |
| // Books Collection |