Skip to content

Instantly share code, notes, and snippets.

@davidgljay
davidgljay / ComponentIndex.js
Last active June 12, 2022 19:22
Pattern for dynamically loading React components based on a config json object.
import config from '../config'
let components = {}
//For each component in the config fiel into an object
for (var i = config.length - 1; i >= 0; i--) {
components[config[i].name] = require(config[i].path).default
}
export default components
@lahdo
lahdo / 1-one-row-expressions.js
Created March 22, 2017 10:33 — forked from olvnikon/1-one-row-expressions.js
Javascript tricky questions. Check yourself. Or destroy any interviewee.
// https://jsfiddle.net/vk35ok2o/50/
console.log('typeof 1/0 => ', typeof 1/0);
console.log('typeof (1/0) => ', typeof (1/0));
console.log('1/0 => ', 1/0);
console.log('"Hello" * 2 => ', "Hello" * 2);
console.log('typeof ("Hello" * 2) => ', typeof ("Hello" * 2));
console.log('typeof "Hello" * 2 => ', typeof "Hello" * 2);
console.log('typeof undefined => ', typeof undefined);
console.log('typeof null => ', typeof null);
console.log('typeof function(){} => ', typeof function(){});
@nadavrot
nadavrot / Matrix.md
Last active July 1, 2024 17:31
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of