Skip to content

Instantly share code, notes, and snippets.

View copy-ninja1's full-sized avatar
🏠
Working from home

Emmanuel copy-ninja1

🏠
Working from home
View GitHub Profile
@salembaira
salembaira / next.config.js
Last active August 18, 2021 08:28
next.config.js for importing external css files, images and fonts. Easily modified for supporting SASS/LESS. Also includes some production optimizations (services workers, css purging)
const withPlugins = require('next-compose-plugins');
const withImages = require('next-images');
const path = require('path');
const withOffline = require('next-offline');
const withCSS = require('@zeit/next-css');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const withPurgeCss = require('next-purgecss');
const {
PHASE_PRODUCTION_BUILD,
@aalemayhu
aalemayhu / shell.bash
Created April 24, 2022 08:15
How to fix npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
npm set registry=https://registry.npmjs.org/
@mikermcneil
mikermcneil / advanced-javascript.md
Last active December 14, 2022 13:53
Some things I've learned about writing Javascript

You know, if you simplify something, you don't have to work as hard, learn as much, or bother other people with as much complexity.

That's how I like to write code anyway. More conventions, fewer ways to do things, less cognitive load.

More creative energy to make good decisions. More brain space to move quickly.

Here's what I'd say if I was teaching a younger version of myself advanced JavaScript:

  • data types
  • made a commitment not to use classes, new, or constructors at all (plenty of other ways to look clever)