This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addWorkspaces:(stageName) => { | |
const stagePath = path.join(rootDir, stageName); | |
const packagesPath = path.join(rootDir, 'packages'); | |
const packageJson = path.join(stagePath, 'package.json'); | |
if (fs.existsSync(packageJson)) { | |
const dirs = fs.readdirSync(packagesPath, { withFileTypes:true }) | |
.filter(dirent=>dirent.isDirectory()).map(dir=>dir.name); | |
let workspaces = []; | |
let packages = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export MOUNT_DEV=/dev/sda1 | |
export MOUNT_POINT=/mnt | |
sudo -E mount $MOUNT_DEV $MOUNT_POINT | |
sudo -E mount --bind /dev $MOUNT_POINT/dev | |
sudo -E mount --bind /proc $MOUNT_POINT/proc | |
sudo -E mount --bind /run $MOUNT_POINT/run | |
sudo -E mount --bind /sys $MOUNT_POINT/sys | |
sudo -E chroot $MOUNT_POINT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo gawk -i inplace '{ | |
if ($0 ~ /debian\.org|nodesource\.com|docker\.com/) { | |
print gensub(/buster/, "bullseye", "g") | |
} else { | |
print $0 | |
} | |
}' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ^~ /myapp/ { | |
proxy_pass http://0.0.0.0:3001/; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection 'upgrade'; | |
proxy_set_header Host $host; | |
proxy_cache_bypass $http_upgrade; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = { | |
modify: (defaultConfig, { target, dev }, webpack) => { | |
const config = Object.assign({}, defaultConfig); | |
config.module.rules = config.module.rules.reduce((rules, rule) => { | |
if (rule.exclude && | |
rule.loader.indexOf('file-loader') !== -1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const path = require('path'); | |
const fs = require('fs'); | |
const appDirectory = fs.realpathSync(process.cwd()); | |
const resolveApp = relativePath => path.resolve(appDirectory, relativePath); | |
module.exports = { | |
modify: (defaultConfig, { target, dev }, webpack) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useLayoutEffect } from 'react'; | |
// eslint-disable-next-line max-len | |
// See https://github.com/reduxjs/react-redux/blob/316467a/src/hooks/useSelector.js#L6-L15 | |
export const useIsomorphicLayoutEffect = | |
typeof window !== 'undefined' ? useLayoutEffect : useEffect; | |
export const useServerNoopLayoutEffect = | |
typeof window !== 'undefined' ? useLayoutEffect : () => ({}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The passed list of environment variables will be removed from the nodejs | |
* instance of webpack.DefinePlugin, so they can be resolved dynamically at | |
* runtime. | |
* @example | |
* // Include this in the plugins array exported by razzle.config.js | |
* const nodeRuntimeVarsPlugin = createRazzlePluginNodeRuntimeVars('PORT', 'HOST'); | |
* @param {String} ...nodeRuntimeVars | |
* @return {Function} | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- webpackHotDevClient.orig.js 2019-10-24 21:33:25.464549772 +0200 | |
+++ webpackHotDevClient.js 2019-10-24 21:40:27.485125571 +0200 | |
@@ -22,7 +22,7 @@ | |
url.format({ | |
protocol: window.location.protocol, | |
hostname: window.location.hostname, | |
- port: parseInt(process.env.PORT || window.location.port, 10) + 1, | |
+ port: process.env.RAZZLE_HOTCLIENT_NOPORT ? '' : parseInt(process.env.PORT || window.location.port, 10) + 1, | |
pathname: launchEditorEndpoint, | |
search: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chattr -i /etc/resolv.conf | |
mv /etc/resolv.conf /etc/resolv.conf.bak.$(date +%FT%H%M) | |
echo nameserver 185.56.187.149 >/etc/resolv.conf | |
echo nameserver 87.238.35.136 >>/etc/resolv.conf | |
chattr +i /etc/resolv.conf |