This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let colLarge = [ | |
[1,1,1,1,1,4], | |
[1,1,1,1,1,4], | |
[1,1,1,1,1,4], | |
[1,1,1,1,1,4], | |
[1,1,1,1,1,1], | |
[1,1,1,1,1,1] | |
] | |
let rowLarge = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getUndefinedKeys(checkObject, keys) { | |
return keys.filter(key => { | |
let splitKey = key.split('.'); | |
let currentObj = checkObject; | |
let currentIndex = 0; | |
while(!isKeyUndefined(currentObj, splitKey[currentIndex]) && currentIndex < splitKey.length) { | |
currentObj = currentObj[splitKey[currentIndex]]; | |
currentIndex++; | |
} | |
return currentIndex <= splitKey.length - 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setTimeout(callback, timeout) { | |
let startTime = Date.now(); | |
function loop(){ | |
if (Date.now() >= startTime + timeout) { | |
callback(); | |
} else { | |
loop(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<form> | |
<select name="app"> | |
<option value="app1">App 1</option> | |
<option value="amazingAppMuchWow">App 2</option> | |
</select> | |
<input name="serial" placeholder="Serial goes here" type="text" /> | |
<button type="submit">Gimme an url!</button> | |
<div class="pair"> | |
<input type="text" placeholder="key"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
class Panel extends Component { | |
state = { | |
width: 200, | |
dragging: false, | |
offset: 0 | |
}; | |
dragStart = e => { | |
this.setState({ dragging: true }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Row = props => { | |
const {issueId, issueLink, qaName, number, voteCount} = props; | |
return ( | |
<tr> | |
<td>${number}</td> | |
<td>${voteCount}</td> | |
<td>${issueId}</td> | |
<td>${qaName}</td> | |
<td> | |
<a href=${issueLink} target="_blank">${issueLink}</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const SAMPLE_DATA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; | |
function divideInto(data, chunkSize) { | |
// make the container arrays | |
const containers = []; | |
for (let i = 0; i < chunkSize; i++) { | |
containers[i] = []; | |
} | |
// push bits of data into each of the arrays; | |
data.forEach((item, index) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I wated to take a look at way to structure data that we've used on the RCE and other apps | |
// basically it looks like this: | |
const flatList = { | |
byId: { | |
1: { | |
id: 1, | |
someProp: true, | |
text: 'A sample text', | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function compare(a,b) { | |
return a == b; | |
} | |
function compareStrict(a,b) { | |
return a === b; | |
} | |
let a = {a:1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fibonacci = (limit, list=[1, 1]) => { | |
const currentIndex = list.length - 1 | |
const newNumber = list[currentIndex - 1] + list[currentIndex] | |
if( newNumber >= limit) { | |
return list | |
} else { | |
return fibonacci(limit, list.concat([newNumber]), currentIndex + 1) | |
} | |
} |
OlderNewer