Skip to content

Instantly share code, notes, and snippets.

View FatehAK's full-sized avatar
💻
¯\_(ツ)_/¯

Fateh AK FatehAK

💻
¯\_(ツ)_/¯
View GitHub Profile
@Lucasdsk
Lucasdsk / HTTP to HTTPS redirect with NextJs Heroku.md
Created May 5, 2021 22:40
HTTP to HTTPS redirect with NextJs Heroku

To configure an HTTP -> HTTPS redirect using NextJs on Heroku, is necessary to configure a NextJs custom server.

Here is a custom server configured with the redirect working:

server.js

const express = require('express');
const cookieParser = require("cookie-parser");
const next = require('next');
@sindresorhus
sindresorhus / esm-package.md
Last active June 15, 2024 16:08
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@marteinn
marteinn / _document.js
Created September 26, 2020 06:27
Next.js: How to capture and use page props in next/document
import Document, { Html, Head, Main, NextScript } from 'next/document';
class CustomDocument extends Document {
static async getInitialProps(ctx) {
let pageProps = null;
const originalRenderPage = ctx.renderPage;
ctx.renderPage = () =>
originalRenderPage({
enhanceApp: (App) => (props) => {
@siakaramalegos
siakaramalegos / future_performance.md
Last active October 4, 2022 19:08
The Future of Front-End Performance

The Future of Front-End Performance

Help! My app bundle is 5MB! My users are angry that my app is so slow! It’s easy to forget that performance matters when we are under pressure to deliver features quickly. What data should we use to inform our decisions? From code splitting, lazy loading, and tree shaking to bundle analysis, progressive rendering, and modern transpiling, come learn how you can deliver a better experience to your users with high-performing front-end apps. This talk is library-agnostic (React, Angular, Vue, etc.).

The most recent version of the slides for this talk are here on SpeakerDeck (from RWX2018).

You can watch the video from Full Stack Fest in Barcelona here:

<a href="http://www.youtube.com/watch?feature=player_embedded&v=SA_Hp8l7lr4 " target="_blank">

@rxaviers
rxaviers / gist:7360908
Last active June 14, 2024 18:27
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: