-
Step 1 - Install the dependencies
- eslint
- ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code.
npm install --save-dev eslint
- typescript-eslint/parser
- eslint
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
| // | |
| // Cubes and diamonds. | |
| // Created using Processing 3.5.3. | |
| // | |
| // Code by @marcedwards from @bjango. | |
| // | |
| // A GIF of this code can be seen here: | |
| // https://twitter.com/marcedwards/status/1167765622899347459 | |
| // |
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 React from 'react'; | |
| import useCanvas from './useCanvas'; | |
| import useWindowSize from './useWindowSize'; | |
| const Canvas = (props) => { | |
| const [canvasRef, tracer] = useCanvas('2d'); | |
| const [width, height] = useWindowSize(); | |
| const draw = tracer((gl) => { | |
| gl.clearRect(0, 0, width, height); |
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 path = require('path'); | |
| const withLess = require('@zeit/next-less'); | |
| const withPlugins = require('next-compose-plugins'); | |
| const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); | |
| const CleanCss = require('clean-css'); | |
| const nextConfig = { | |
| webpack(config) { | |
| config.module.rules.push({ | |
| test: /\.(png|svg|eot|otf|ttf|woff|woff2)$/, |
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 { ConfigInterface, useSWRInfinite } from 'swr' | |
| import { useMemo, useCallback, useRef } from 'react' | |
| import last from 'lodash.last' | |
| import get from 'lodash.get' | |
| type PageKeyMaker<Page, Key extends any[]> = ( | |
| index: number, | |
| previousPageData?: Page | |
| /** | |
| * Mutable ref object. Set this to `true` before the request and `false` afterwards if the request is fetching more. |
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 { HttpService, Injectable, Logger } from '@nestjs/common'; | |
| import { InjectModel } from '@nestjs/sequelize'; | |
| import { ReadStream } from 'fs'; | |
| import { Sequelize } from 'sequelize-typescript'; | |
| import * as xlsx from 'xlsx'; | |
| import { WorkBook, WorkSheet } from 'xlsx'; | |
| import { ArquivoImportacao } from './dto/arquivo-importacao.dto'; | |
| @Injectable() | |
| export class ImportacaoProcessosService { |
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 { Controller, Get, Req, Res, UseGuards } from '@nestjs/common'; | |
| import { Request, Response } from 'express'; | |
| import { GoogleOauthGuard } from './google-oauth.guard'; | |
| @Controller('auth/google') | |
| export class GoogleOauthController { | |
| constructor(private jwtAuthService: JwtAuthService) {} | |
| @Get() | |
| @UseGuards(GoogleOauthGuard) |
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 { useState } from "react"; | |
| import styled from "styled-components"; | |
| import { useKeenSlider } from "keen-slider/react"; | |
| import {SliderProductCard} from "@components/ui"; | |
| import { ArrowFilterIcon } from "@components/icons"; | |
| import { colors } from "styles/variables"; | |
| const ProductSlider = ({ | |
| background, |
These are the steps to setup an Ubuntu server from scratch and deploy a MERN app with the PM2 process manager and Nginx. We are using Linode, but you could just as well use a different cloud provider or your own machine or VM.
Create an account at Linode
Click on Create Linode
Choose your server options (OS, region, etc)
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
| /* | |
| This is an example about how to use a public client written in Golang to authenticate using Keycloak. | |
| This example is only for demonstration purposes and lacks important | |
| */ | |
| package main | |
| import ( | |
| "encoding/json" | |
| "errors" | |
| "log" |