Help with SQL commands to interact with a MySQL database
- Mac /usr/local/mysql/bin
- Windows /Program Files/MySQL/MySQL version/bin
- Xampp /xampp/mysql/bin
function once(func) { | |
let hasExecuted = false; | |
let result; | |
return function () { | |
if (hasExecuted) return result; | |
hasExecuted = true; | |
result = func.apply(this, arguments); | |
func = null; |
// Basic Types | |
let id: number = 5 | |
let company: string = 'Traversy Media' | |
let isPublished: boolean = true | |
let x: any = 'Hello' | |
let ids: number[] = [1, 2, 3, 4, 5] | |
let arr: any[] = [1, true, 'Hello'] | |
// Tuple |
import React, { useEffect, useState, useMemo } from 'react'; | |
import { fetchEmployees } from '../api/employees'; | |
const EmployeeSearchContainer = (props) => { | |
const [selectedEmployee, setSelectedEmployee] = useState(null); | |
const [isLoading, setIsLoading] = useState(false); | |
const [searchText, setSearchText] = useState(''); | |
const [employees, setEmployees] = useState([]); |
function cached(fn){ | |
// Create an object to store the results returned after each function execution. | |
const cache = Object.create(null); | |
// Returns the wrapped function | |
return function cachedFn (str) { | |
// If the cache is not hit, the function will be executed | |
if ( !cache[str] ) { | |
let result = fn(str); |
All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.
A number of methods in React are assumed to be "pure".
On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.
Uncle Bob, the well known author of Clean Code, is coming back to us with a new book called Clean Architecture which wants to take a larger view on how to create software.
Even if Clean Code is one of the major book around OOP and code design (mainly by presenting the SOLID principles), I was not totally impressed by the book.
Clean Architecture leaves me with the same feeling, even if it's pushing the development world to do better, has some good stories and present robust principles to build software.
The book is build around 34 chapters organised in chapters.