React: Unexpected use of 'location';Solution: Use window.location instead of bare location.
| import * as server from "./server"; | |
| new server.App |
| 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() { |
| // Logs all calls to preventDefault / stopPropagation in an user-friendly way | |
| if ( process.env.NODE_ENV !== "production" ) { | |
| (function monkeyPatchEventMethods() { | |
| const logEventMethodCall = (event,methodName) => { | |
| const MinimumMeaninfulSelectors = 3; // how much meaningful items we want in log message | |
| const target = event.target; | |
| const selector = (function computeSelector() { |
| import Head from 'next/head' | |
| import { Container } from 'reactstrap' | |
| const Layout = (props) => ( | |
| <div> | |
| <Head> | |
| <title>PairHub</title> | |
| <meta name="viewport" content="initial-scale=1.0, width=device-width" /> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" /> | |
| </Head> |
React: Unexpected use of 'location';Solution: Use window.location instead of bare location.
| var count =Math.floor(Math.random()*100); | |
| process.on('message', (msg)=>{ | |
| console.log("CHILD: message received from parent process", msg); | |
| count = parseInt(msg) +1; | |
| console.log("CHILD: +1 from child"); |
| const publicPath = 'public'; | |
| // Node os module | |
| // The os module provides a number of operating system-related utility methods. | |
| // It can be accessed using: | |
| const os = require('os'); | |
| // Using a single monolithic configuration file impacts comprehension and | |
| // removes any potential for reusability. | |
| // As the needs of your project grow, you have to figure out the means to manage | |
| // webpack configuration more effectively. |
| # Open font in [fontforge](https://fontforge.github.io/en-US/) (FontAwesome's [fa-solid-900.woff](https://github.com/FortAwesome/Font-Awesome/blob/master/webfonts/fa-solid-900.woff) in my case) | |
| # So you can see what you're doing: Menu > Encoding > Compact | |
| # ctrl+a to select all glyphs | |
| # ctrl+. should open Execute Script | |
| # Ensure desiredGlyphNames includes all glyphs used in app | |
| desiredGlyphNames = ["caret-down", "caret-up", "chart-bar", "check", "chevron-down", "clipboard-list", "comments", "expand", "filter", "flask", "images", "info-circle", "layer-group", "redo", "ruler", "ruler-horizontal", "ruler-vertical", "sort-amount-down", "star", "table", "tag", "users", "video"] | |
| font = fontforge.activeFont() |
| // Add any other logic here as needed. | |
| import { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin'; | |
| import { CacheFirst } from 'workbox-strategies/CacheFirst'; | |
| import { createHandlerForURL } from 'workbox-precaching/createHandlerForURL'; | |
| import { ExpirationPlugin } from 'workbox-expiration/ExpirationPlugin'; | |
| import { NavigationRoute } from 'workbox-routing/NavigationRoute'; | |
| import { precacheAndRoute } from 'workbox-precaching/precacheAndRoute'; | |
| import { registerRoute } from 'workbox-routing/registerRoute'; |
| const net = require('net') | |
| const opts = { | |
| host: 'localhost', | |
| port: 1234, | |
| sockets: 2000, | |
| respawn: false, | |
| rate: 600, | |
| method: 'GET', | |
| path: '/' |