Skip to content

Instantly share code, notes, and snippets.

View scriptcoded's full-sized avatar

Malcolm Nihlén scriptcoded

View GitHub Profile
@scriptcoded
scriptcoded / webpack-setup.md
Last active October 29, 2020 08:17
Webpack setup cheat-sheet (with webpack-dev-server)

Summarized from https://www.valentinog.com/blog/from-gulp-to-webpack-4-tutorial/

Intro

This is a quick summary on how to install webpack with webpack-dev-server, and set up Babel and image compression. This is by no means a complete tutorial, but rather a quick cheat-sheet.

Dependencies

If not already done, init your project package.json file.

@andrew8088
andrew8088 / stringify.js
Last active August 23, 2022 07:54
A simple implementation of JSON.stringify; covers every case I could think of
function stringify(obj) {
if (typeof obj !== 'object' || obj === null || obj instanceof Array) {
return value(obj);
}
return '{' + Object.keys(obj).map(function (k) {
return (typeof obj[k] === 'function') ? null : '"' + k + '":' + value(obj[k]);
}).filter(function (i) { return i; }) + '}';
}