Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

---
import { withBranch, renderComponent } from 'recompose';
withBranch(
props => props.data.loading,
renderComponent(CustomGhostComponent),
);
---
import { withProps, compose } from 'recompose';
import { withGhost } from '@aap/boostrap';
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jakwuh
jakwuh / configured-webpack.txt
Created September 8, 2018 11:55
2.2 webpack `node` configuration size comparison
Hash: 8ebeffa40e80dcf45116
Version: webpack 4.17.1
Child
Hash: 8ebeffa40e80dcf45116
Time: 35ms
Built at: 09/08/2018 2:54:15 PM
Asset Size Chunks Chunk Names
server.js 4.55 KiB main [emitted] main
Entrypoint main = server.js
[./src/entries/server.jsx] 118 bytes {main} [built]
@jakwuh
jakwuh / no-node-externals.txt
Last active September 8, 2018 11:40
2.1 `webpack-node-externals` build time / size comparison
Hash: 83ea41009a25bd992f66e3fbc3208c63a07d0073
Version: webpack 4.17.1
Child
Hash: 83ea41009a25bd992f66
Time: 6713ms
Built at: 09/08/2018 2:25:38 PM
Asset Size Chunks Chunk Names
bundle.js 3.22 MiB main [emitted] main
Entrypoint main = bundle.js
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 489 bytes {main} [built]
@jakwuh
jakwuh / Readme.md
Last active March 21, 2019 11:06
React 16 and beyond

React 16 and beyond

This document is created to overview existing React 16+ features. Last updated: 21/03/2019

New fragments syntax

Earlier React supported only single return from the render method:

 render() {
@jakwuh
jakwuh / Readme.md
Last active September 27, 2018 16:56
Scalable React applications

Checklist

  • Read about [the story behind react-boilerplate][1]
  • Explore [the structure of react-boilerplate][2]
  • Explore the structure of [scalable-react-boilerplate][3]
  • Read Medium article on [designing large JS applications][4]
  • Read Medium article on [structuring large React applications][5]
  • Read Medium article on [scalable fractal React app structure][13]
  • Read about [feature flags][14]
  • Complete Pluralsight course on [Building Scalable React applications][6]
@jakwuh
jakwuh / index.html
Last active November 23, 2017 21:02
Akinator
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Akinator</title>
</head>
<body>
<span id="question"></span>
<br>
<button id="firstButton" type="button" name="button"></button>
{
"presets": ["env"],
"plugins": [
"transform-typescript",
"transform-class-properties"
]
}
@jakwuh
jakwuh / tcp_nodelay_false
Created September 15, 2017 20:00
TCP_NODELAY experiment
> tcpdump -i lo0 dst port 1995
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo0, link-type NULL (BSD loopback), capture size 262144 bytes
22:29:03.261714 IP localhost.62949 > localhost.perf-port: Flags [SEW], seq 1585304512, win 65535, options [mss 16344,nop,wscale 5,nop,nop,TS val 259925136 ecr 0,sackOK,eol], length 0
22:29:03.361942 IP localhost.62949 > localhost.perf-port: Flags [S], seq 1585304512, win 65535, options [mss 16344,nop,wscale 5,nop,nop,TS val 259925236 ecr 0,sackOK,eol], length 0
22:29:03.462581 IP localhost.62949 > localhost.perf-port: Flags [S], seq 1585304512, win 65535, options [mss 16344,nop,wscale 5,nop,nop,TS val 259925336 ecr 0,sackOK,eol], length 0
22:29:03.562713 IP localhost.62949 > localhost.perf-port: Flags [S], seq 1585304512, win 65535, options [mss 16344,nop,wscale 5,nop,nop,TS val 259925436 ecr 0,sackOK,eol], length 0
22:29:03.664244 IP localhost.62949 > localhost.perf-port: Flags [S], seq 1585304512, win 65535, options [mss 16344,no
@jakwuh
jakwuh / webpack.config.js
Created July 6, 2017 17:34
Webpack+React production config
let {resolve} = require('path');
let webpack = require('webpack');
module.exports = {
entry: resolve('index.js'),
output: {
path: resolve('dist'),
filename: 'bundle.js'
},
plugins: [