Sometimes we need to share props and behaviour between multiple components/containers. For that we can do a higher order component. Example:
Higher Order Component that will decorate other component:
| #ack is a tool like grep, designed for programmers with large trees of heterogeneous source code | |
| #to install ack, see http://betterthangrep.com/ | |
| #to use ack, launch terminal (mac osx) and type 'ack <some_keywords>' | |
| #ack will search all files in the current directory & sub-directories | |
| #here's how I have my config file setup. this file is located on mac osx here | |
| # ~/.ackrc | |
| # Always sort the files |
| # 0 is too far from ` ;) | |
| set -g base-index 1 | |
| # Automatically set window title | |
| set-window-option -g automatic-rename on | |
| set-option -g set-titles on | |
| #set -g default-terminal screen-256color | |
| set -g status-keys vi | |
| set -g history-limit 10000 |
| [config] | |
| command = bash deploy.sh |
| 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) { |
| // Shinobi (http://shinobi.video) - FFMPEG H.264 over HTTP Test | |
| // How to Use raw H.264 (Simulated RTSP) | |
| // 1. Start with `node ffmpegToWeb.js` | |
| // 2. Get the IP address of the computer where you did step 1. Example : 127.0.0.1 | |
| // 3. Open VLC and "Open Network Stream". | |
| // 4. Input the following without quotes : `http://127.0.0.1:8001/h264` and start. | |
| var child = require('child_process'); | |
| var io = require('socket.io'); | |
| var events = require('events'); |
| #remember to edit the .template/openbsd.conf to set the correct version. | |
| pkg install vm-bhyve | |
| zfs create pool/vm | |
| echo 'vm_enable="YES"' >> /etc/rc.conf | |
| echo 'vm_dir="zfs:pool/vm"' >> /etc/rc.conf | |
| vm init | |
| cp /usr/local/share/examples/vm-bhyve/* /mountpoint/for/pool/vm/.templates/ | |
| vm switch create public | |
| vm switch add public em0 |
| log4j.debug=false | |
| # Default level is INFO | |
| log4j.rootLogger=INFO,StdoutErrorFatal,StdoutWarn,StdoutInfo,StdoutDebug,StdoutTrace | |
| # and for com.some.package.* log everything | |
| log4j.logger.com.some.package=TRACE | |
| log4j.appender.StdoutErrorFatal=org.apache.log4j.ConsoleAppender | |
| log4j.appender.StdoutErrorFatal.layout=org.apache.log4j.PatternLayout |
| #!/bin/bash | |
| if [ -z "$VERSION" ]; then | |
| echo 'Please specify a version. e.g, "VERSION=3.8.5 sh install-python-alpine.sh"' | |
| exit | |
| fi | |
| export PYTHON_DOWNLOAD_URL=https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz | |
| sudo apk update |