- To not retyping fucking ssh passphrase key each fucking time: http://superuser.com/a/1158050
- Create a jetty test server: http://stackoverflow.com/a/29759263/3650955
- WebpackExtractPlugin with HMR: webpack-contrib/extract-text-webpack-plugin#30 (comment)
if (process.env.NODE_ENV !== "production") {
if (module.hot) {
const reporter = window.__webpack_hot_middleware_reporter__;
const success = reporter.success;
const DEAD_CSS_TIMEOUT = 2000;
reporter.success = function() {
document.querySelectorAll("link[href][rel=stylesheet]").forEach((link) => {
const nextStyleHref = link.href.replace(/(\?\d+)?$/, `?${Date.now()}`);
const newLink = link.cloneNode();
newLink.href = nextStyleHref;
link.parentNode.appendChild(newLink);
setTimeout(() => {
link.parentNode.removeChild(link);
}, DEAD_CSS_TIMEOUT);
});
success();
};
}
}
The following only works if I run webpackHotUpdate()
function manually in the browser console.
const cssFileName = 'bundle.css';
const originalCallback = global.webpackHotUpdate;
window.webpackHotUpdate = (...args) => {
const links = document.getElementsByTagName('link');
for (let i = 0; i < links.length; i += 1) {
const link = links[i];
if (link.href.search(cssFileName) !== -1) {
const linkHref = link.href;
link.href = 'about:blank';
link.href = linkHref;
originalCallback(...args);
return;
}
}
};
- Change child by the hover of parent: http://stackoverflow.com/a/5061953/3650955
- CSS Modules import variables from external css file: http://stackoverflow.com/a/40779921/3650955
- Coloring svg: http://codepen.io/noahblon/post/coloring-svgs-in-css-background-images
- Thmeleaf index template not found like error: http://stackoverflow.com/a/31946688/3650955
- react-bootstrap center navbar items:
.container {
text-align: center
}
- CSS: child above the parent (similar to overflow: visible)
#child {
position: relative;
z-index: 3; /* I didn't need that one */
}
- Error resolving template "index", template might not exist or might not be accessible by any of the configured Template Resolvers
mvn package // this command fixes the error
- webpack:///./~/react-transform-catch-errors/lib/index.js?:36 ReferenceError: "setTimeout" is not defined: Removed the line the it has been fixed:
console.log(this.props.location);
-
Stupid Java regex for html: https://github.com/ufukomer/qbloomy/pull/27/commits/9ecc21e494af5b7582ae09fee70f80fff4567ec8#diff-38a3d2be5c964a48104e6615b036d06cL74
-
Are JSON web services vulnerable to CSRF attacks?: http://stackoverflow.com/a/11024387/3650955
-
Github repo as an npm package: https://stackoverflow.com/a/28729646/3650955
-
Webpack multiple outputs: webpack/webpack#1189 (comment)
-
React router 4 regex path: remix-run/react-router#391 (comment)