See how a minor change to your commit message style can make a difference.
Tip
Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs
See how a minor change to your commit message style can make a difference.
Tip
Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs
const withCSS = require("@zeit/next-css"); | |
require('dotenv').config() | |
const path = require('path') | |
const Dotenv = require('dotenv-webpack') | |
const withImages = require('next-images') | |
module.exports = withCSS(withImages({ | |
inlineImageLimit: 16384, | |
webpack(config, options) { |
All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.
A number of methods in React are assumed to be "pure".
On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.
<!doctype html> | |
<html><head><script src="app.js"></script></head><body></body></html> |
'use strict'; | |
const crypto = require('crypto'); | |
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters) | |
const IV_LENGTH = 16; // For AES, this is always 16 | |
function encrypt(text) { | |
let iv = crypto.randomBytes(IV_LENGTH); | |
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv); |
List() | |
var list = Immutable.List([1,2,3]) | |
// [1, 2, 3] | |
List.isList() | |
Immutable.List.isList(list) | |
// true | |
List.of() | |
var list = Immutable.List.of(1,2,3); |
var fs = require('fs'); | |
var zlib = require('zlib'); | |
// Read local subtitle, gunzip it, encode to base64 | |
var toUpload; // future gunzipped/base64 encoded string | |
var path = 'foo/bar.srt'; // path to subtitle | |
fs.readFile(path, function(err, data) { // read subtitle | |
if (err) throw err; // handle reading file error | |
zlib.deflate(data, function(err, buffer) { // gunzip it | |
if (err) throw err; // handle compression error |