See how a minor change to your commit message style can make a difference.
git commit -m"<type>(<optional scope>): <description>" \ -m"<optional body>" \ -m"<optional footer>"
See how a minor change to your commit message style can make a difference.
git commit -m"<type>(<optional scope>): <description>" \ -m"<optional body>" \ -m"<optional footer>"
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> |
import { createCipheriv, createDecipheriv, randomBytes } from "crypto"; | |
const ENCRYPTION_KEY: string = process.env.ENCRYPTION_KEY || ""; // Must be 256 bits (32 characters) | |
const IV_LENGTH: number = 16; // For AES, this is always 16 | |
/** | |
* Will generate valid encryption keys for use | |
* Not used in the code below, but generate one and store it in ENV for your own purposes | |
*/ | |
export function keyGen() { |
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 |