This setup includes:
- Setting up a project with Parcel and React
- Healthy codebase: linting and formatting with ESLint and Prettier
- Initialize Styled-Components
- Implement files
const replace = require('@rollup/plugin-replace'); | |
const envKeys = () => { | |
const envRaw = require('dotenv').config().parsed || {}; | |
return Object.keys(envRaw).reduce( | |
(envValues, envValue) => ({ ...envValues, [`process.env.${envValue}`]: JSON.stringify(envRaw[envValue]) }), | |
{} | |
); | |
}; |
import css from "rollup-plugin-css-porter"; | |
import pkg from "../../package.json"; | |
import resolve from "rollup-plugin-node-resolve"; | |
import babel from "rollup-plugin-babel"; | |
import path from "path"; | |
import commonjs from "rollup-plugin-commonjs"; | |
import { terser } from "rollup-plugin-terser"; | |
process.env.BABEL_ENV = "production"; | |
process.env.NODE_ENV = "production"; |
This will work with other flavours of Docker as well.
Run the following command:
docker run --name my-redis -p 6379:6379 --restart always --detach redis
This will download and run redis, set to auto-restart when your machine starts and bound to port 6379 on your machine.
const grpc = require('grpc'), | |
resolve = require('path').resolve | |
const tyk = grpc.load({ | |
file: 'coprocess_object.proto', | |
root: resolve(__dirname, 'tyk-protobuf/proto') | |
}).coprocess | |
const listenAddr = '127.0.0.1:5555', | |
authHeader = 'Authorization' |
When applications are running in production, they become black boxes that need to be traced and monitored. One of the simplest, yet main, ways to do so is logging. Logging allows us - at the time we develop our software - to instruct the program to emit information while the system is running that will be useful for us and our sysadmins.
Problem: How can we preprocess JavaScript (at build-time or on the server-side) so engines like V8 don't have to spend as much time in Parse? This is a topic that involves generating either bytecode or a bytecode-like-abstraction that an engine would need to accept. For folks that don't know, modern web apps typically spend a lot longer in Parsing & Compiling JS than you may think.
A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
/* | |
* http://www.myersdaily.org/joseph/javascript/md5-text.html | |
*/ | |
(function (global) { | |
var md5cycle = function (x, k) { | |
var a = x[0], | |
b = x[1], | |
c = x[2], | |
d = x[3]; |