- Lazy loading screens
- bottom tabs & top tabs
- Tracking renders
- counting the amount of times a component renders.
- added a custom
useRef()
hook into all components / child components.
import { useRef } from 'react';
module.exports = { | |
env: { | |
es2020: true, | |
node: true, | |
}, | |
parser: '@typescript-eslint/parser', | |
parserOptions: { | |
ecmaFeatures: { | |
jsx: true, | |
}, |
const fs = require("fs"); | |
const writeToFile = (file, data) => | |
new Promise((resolve, reject) => { | |
try { | |
if (file) { | |
fs.writeFile(file, data, err => { | |
if (err) { | |
console.log("writeFile error: ", err); | |
resolve({ error: true }) |
const chalk = require('chalk'); | |
const { exec } = require("child_process"); | |
const util = require('util'); | |
const execCommand = (command, displayError = true) => { | |
return new Promise(async (resolve, reject) => { | |
try { | |
const execPromise = util.promisify(exec); | |
const { stdout, error } = await execPromise(command, { cwd: process.cwd() }) | |
if (stdout) { | |
return resolve({ stdout, error: false }) |
# ------------------------------- | |
# ENVIRONMENT CONFIGURATION | |
# ------------------------------- | |
# Change Prompt | |
# ------------------------------------------------------------ | |
# PS1 settings | |
# --------------------------------------------------- | |
# colors | |
export COLOR_NC='\e[0m' # No Color |
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
{ | |
function LinkedList() { | |
this.head = null; | |
this.tail = null; | |
} | |
function Node(value, next, prev) { | |
this.value = value; | |
this.next = next; | |
this.prev = prev; |
// server.js file | |
const express = require('express'); | |
const mongoose = require('mongoose'); | |
const app = express(); | |
// | |
// ─── DATABASE ─────────────────────────────────────────────────────────────────── | |
// | |
// DB Config |
// DB Config | |
const db = require('./config/keys').mongoURI; | |
// connect to mongoDB | |
mongoose | |
.connect(db) | |
.then(() => { | |
console.log('MongoDB Connected'); | |
}) | |
.catch(err => { |
// replace <dbuser>: with your admin's username | |
// replace <dbpassword> with your admin's password | |
module.exports = { | |
mongoURI: 'mongodb://<dbuser>:<dbpassword>@ds123456.mlab.com:1234556/project-name' | |
} |