This file contains 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 { useRouter } from "next/router"; | |
/** The supported languages as enums */ | |
export enum Language { | |
English = "en", | |
Norwegian = "no", | |
} | |
export type LanguageObject = { | |
[key in Language]: string | React.ReactNode; | |
}; |
This file contains 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
(Verse 1) | |
Yeah, it's pretty clear, I ain't no Git rookie | |
But I can merge it, merge it, like I'm supposed to do | |
'Cause I got that repo that all the devs chase | |
All the right branches and all the right bases | |
(Pre-Chorus) | |
I see the dev team working that commit race | |
We know that merge ain't the only way to save face | |
If you got Git skills, skills |
This file contains 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
type Response = { | |
hostname: string; | |
requestUrl: string; | |
title: string; | |
description: string; | |
image?: { | |
url: string; | |
alt?: string; | |
}; | |
details: Details; |
This file contains 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 express = require('express'); | |
require('babel-register')({ | |
ignore: /\/(build|node_modules|.svg)\//, | |
presets: ['env', 'react-app'] | |
}); | |
const universal = require('./universal'); | |
const app = express(); |
This file contains 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
{ | |
"Create a useState block": { | |
"prefix": ["useState", "us"], | |
"body": [ | |
"const [${1:state}, set${1/(.*)/${1:/capitalize}/}] = React.useState(${2:initialState})" | |
], | |
"description": "Create a regular useState hook" | |
}, | |
"Create a useEffect block": { | |
"prefix": ["useEffect", "ue"], |
This file contains 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
module Main exposing (..) | |
import Browser | |
import Html exposing (..) | |
import Html.Attributes as A | |
import Html.Events as Events | |
import Http | |
main = |
This file contains 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 Pica from 'pica'; | |
const getImageFromFile = file => | |
new Promise(resolve => { | |
const reader = new FileReader(); | |
const image = new Image(); | |
reader.onload = async fileReaderEvent => { | |
image.onload = () => resolve(image); | |
image.src = await fileReaderEvent.target.result; | |
}; |
This file contains 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 config = { | |
// First, let's define an entry point for webpack to start its crawling. | |
entry: './src/index.js', | |
// Second, we define where the files webpack produce, are placed | |
output: { | |
path: path.resolve(__dirname, 'dist'), | |
filename: 'bundle.js', | |
}, |
This file contains 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 config = { | |
// First, let's define an entry point for webpack to start its crawling. | |
entry: './src/index.js', | |
// Second, we define where the files webpack produce, are placed | |
output: { | |
path: path.resolve(__dirname, 'dist'), | |
filename: 'bundle.js', | |
}, |
This file contains 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 MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
const isProduction = process.env.NODE_ENV === 'production'; | |
const config = { | |
// First, let's define an entry point for webpack to start its crawling. | |
entry: './src/index.js', | |
// Second, we define where the files webpack produce, are placed | |
output: { |
NewerOlder