Skip to content

Instantly share code, notes, and snippets.

cards-marketing {
display: -ms-flexbox;
display: flex;
-ms-flex-pack: center;
justify-content: center;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
padding: 0 0.75rem;
max-width: calc(640px - 1.5rem);
margin: 0 auto; }
// assume a function retrieves data from the repositories and leaves us with a 2-dimensional array
// the size of the number of the repositories, and each repository's array containing
// key value paired objects of the byte size and name of the language
// repositories:
// [
// [
// {
// name: 'CSS',
// size: 2000
// pseudocode
// create a new array for holding each language and a running sum of its size
// loop through each repository
// loop through each language, within each repository
// for each language, add it to its matching entry and add the size to the running sum
// get the sum of all of the sums of languages
// return the array and the total sum
// pseudocode
// create a new array for holding each language and a running sum of its size
^^^^ is this the best way to hold this data for what we are going to use it for? ^^^^
// loop through each repository
^^^^ we definitely cannot avoid this ^^^^
// loop through each language, within each repository
^^^^ can we avoid this? ^^^^ <--- we MIGHT be able to reduce complexity here
// for each language, add it to its matching entry and add the size to the running sum
^^^^ can we do this differently, avoiding a loop? ^^^^ <--- we CAN reduce complexity here
// pseudocode
// create a new hash map for holding each language and a running sum of its size
// loop through each repository
////// loop through each language
///////// add it to its matching entry and add the size to the running sum
///////// add the size to the running sum of all languages
// return languages and total sum
// Consider all numbers on a number line from x to y.
// Compare each number in sequence to every other number: inclusive, once.
// For x = 10, and y = 15
// 10, 11
// 10, 12
// 10, 13
// 10, 15
// ...
// Consider all numbers on a number line from x to y.
// Compare each number in sequence to every other number: inclusive, once.
// For x = 5, and y = 8
// d = 3
// d^2 + d = 12
// 5, 6 6, 7 7, 8 8, 5
// 5, 7 6, 8 7, 5 8, 6
// 5, 8 6, 5 7, 6 8, 7
@cherscarlett
cherscarlett / disable.js
Created October 5, 2019 20:39
Disabling pointer events outside of your popup in React
useLayoutEffect(
() => {
const {current: menuDOM} = menuRef;
const body = window.document.querySelector('body');
if (menuDOM && isOpen) {
body.style['pointer-events'] = 'none';
menuDOM.style['pointer-events'] = 'initial';
} else if (menuDOM && !isOpen) {
body.style['pointer-events'] = null;
menuDOM.style['pointer-events'] = null;
{
"window.zoomLevel": 0,
"diffEditor.ignoreTrimWhitespace": false,
"editor.fontFamily": "Victor Mono",
"editor.fontLigatures": true,
"workbench.colorTheme": "SynthWave '84",
"synthwave84.brightness": "1.5",
"editor.tokenColorCustomizations": {
"textMateRules": [
{
.mtk3, .mtk6 {
color: #36f9f6;
text-shadow: 0 0 2px #001716, 0 0 5px #03edf933, 0 0 10px #ffff6633;
}
.mtk3.mtki {
font-style: italic;
color: #9963ff99;
}