Skip to content

Instantly share code, notes, and snippets.

View junibrosas's full-sized avatar
🎯
Create! create! create!

Juni Brosas junibrosas

🎯
Create! create! create!
View GitHub Profile
@jjsquady
jjsquady / nextjs-deploy.md
Last active April 25, 2024 20:49
Deploying NEXTJS site with nginx + pm2

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

@NathanielHill
NathanielHill / next.config.js
Created December 28, 2018 18:28
Next.js Config Boilerplate
const emoji = require('remark-emoji')
const fs = require('fs')
const nextOffline = require('next-offline')
const path = require('path')
const withMDX = require('@zeit/next-mdx')({
extension: /\.mdx?$/,
options: { mdPlugins: [emoji] }
})
const withPlugins = require('next-compose-plugins')
const { PHASE_DEVELOPMENT_SERVER } = require('next/constants');
const { withPlugins } = require('next-compose-plugins');
const withManifest = require('next-manifest')
const withOffline = require('next-offline')
const forceProd = require('./forceProd')
const manifest = {
"short_name": "next-offline-test-app",
"name": "next-offline-test-app",
"description": "Reproduce a bug to help fix it",
@glemiere
glemiere / server.js
Created June 29, 2018 03:55
Simple file written in ES6 to serve a ExpressJS/NextJS Server.
/**********
server.ts
---------------
Simple file written in ES6 to serve a ExpressJS/NextJS Server.
Uses SSL, Compression, redirection and service worker routing. See server config file at :
https://github.com/glemiere/nextjs-starter/tree/master/config
---------------
Requires Let's Encrypt SSL Certificate :
https://letsencrypt.org/
**********/
import { Injectable, Injector } from '@angular/core';
import { HttpErrorResponse, HttpHandler, HttpInterceptor, HttpRequest, HttpEvent, HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import { ErrorObservable } from 'rxjs/Observable/ErrorObservable';
import { EmptyObservable } from 'rxjs/Observable/EmptyObservable';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { catchError, filter, take, switchMap, finalize } from "rxjs/operators";
import { APIURL } from "../app/constants";
import { UserService } from "./user/user.provider";
@mknabe
mknabe / README.md
Last active September 18, 2021 09:14
React component to warn users about unsaved changes to forms when they attempt navigate away from the page using redux-form

Use with the following

  • react-router
  • redux-form

You must use this compontent on the route component where the form is shown not on the form component itself. This is because this.props.route is only added to route components, and I didn't want to pass that down through props.

Inspired by this Codepad

Feedback appreciated

@mmloveaa
mmloveaa / Find the next perfect square
Last active February 3, 2024 07:36
Find the next perfect square
// 12/22/2015
// You might know some pretty large perfect squares. But what about the NEXT one?
// Complete the findNextSquare method that finds the next integral perfect square after the one passed as a parameter. Recall that
an integral perfect square is an integer n such that sqrt(n) is also an integer.
// If the parameter is itself not a perfect square, than -1 should be returned. You may assume the parameter is positive.
// Examples:
// findNextSquare(121) --> returns 144
// findNextSquare(625) --> returns 676