Skip to content

Instantly share code, notes, and snippets.

View sand97's full-sized avatar

Bruce Guenkam sand97

View GitHub Profile
@sand97
sand97 / Dockerfile
Last active January 20, 2022 13:35
NestJS DockerFile
FROM node:12.13-alpine As development
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
@sand97
sand97 / nest_docker_compose.yml
Created January 20, 2022 13:36
Nest docker_compose
version: '3.7'
services:
main:
container_name: main
build:
context: .
target: development
volumes:
- .:/usr/src/app
@sand97
sand97 / .env
Created January 20, 2022 13:37
NestJS env file
SERVER_PORT=3000
DB_PASSWORD=my-custom-password
DB_USERNAME=first-project-user
DB_DATABASE_NAME=first-project-db
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
PORT=3000
MODE=DEV
#For prisma. Make sure that de pgsql service name, the db name, user
@sand97
sand97 / loader.js
Last active July 11, 2022 08:15
Example of css export for Nextjs splash screen
export default `
body{
display: block;
}
#globalLoader{
position: fixed;
z-index: 1700;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
@sand97
sand97 / _document.js
Last active July 11, 2022 07:45
Example of Nextjs Splash screen _document.js
import React from 'react'
import Document, {Html, Head, Main, NextScript} from 'next/document'
import loader from "../src/loader";
class MyDocument extends Document {
render() {
return (
<Html>
<Head/>
<head>
@sand97
sand97 / _app.js
Last active September 27, 2022 10:12
Example of Nextjs Splash screen _app.js
function MyApp({ Component, pageProps }) {
// Hide splash screen shen we are server side
useEffect(() => {
if (typeof window !== 'undefined') {
const loader = document.getElementById('globalLoader');
if (loader)
loader.style.display = 'none';
}
}, []);