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"; | |
import PropTypes from "prop-types"; | |
import styled from "styled-components"; | |
import { INPUT_TYPES } from "../../constants"; | |
import { isEmpty } from "../../utils"; | |
import Input from "./input"; | |
import Button from "./button"; |
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 NS_PER_SEC = 1e9; | |
const elapsedTimeMs = diff => (((diff[0] * NS_PER_SEC) + diff[1]) / 1e6); | |
const testCount = 1000; | |
const calcResults = (t, heapMem) => console.log("Average Elapsed Time:", (total / testCount).toFixed(2), "ms", "\nHeap Used Memory:", (heapMem / 1e6).toFixed(2), "MB"); | |
let mem = process.memoryUsage(); | |
// anon function :( | |
const obj = {}; |
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
// Create a big object in this and test the methods and see the results. | |
// I could not find a good way to deep clone an object. | |
const o = { | |
}; | |
// declarative version with Object assign | |
// Never use this on big objects! | |
const deepCloneV1 = o => Object.assign({}, o, Object | |
.keys(o) |
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 NS_PER_SEC = 1e9; | |
const elapsedTimeMs = diff => (((diff[0] * NS_PER_SEC) + diff[1]) / 1e6); | |
const arr = []; | |
const arrLen = 10000; | |
let i = 0; | |
console.log("Iteration count: " + arrLen); | |
let startTime = process.hrtime(); | |
while(i < arrLen) { |
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
class SafeObject { | |
constructor(mainObject) { | |
this.mainObject = mainObject; | |
this.configs = { | |
get: SafeObject.get.bind(this) | |
} | |
} | |
static get (target, prop) { | |
if (prop in target) { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
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
/** | |
* Calculates test related statistics for given jira project. | |
*/ | |
export const testWorkflowStats = async ( | |
projectCode: string | |
): Promise<TestWorkFlowStatsResult> => { | |
const project = await readProjectById(projectCode); | |
const [stories, uiTests] = await Promise.all([ | |
readAllStories(projectCode), | |
readAllUiTests(projectCode), |
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
/** | |
* Calculates test related statistics for given jira project. | |
*/ | |
export const testWorkflowStats = async ( | |
projectCode: string | |
): Promise<TestWorkFlowStatsResult> => { | |
const project = await readProjectById(projectCode); | |
const [stories, uiTests] = await Promise.all([ | |
readAllStories(projectCode), | |
readAllUiTests(projectCode), |
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
/** | |
* Calculates test related statistics for given jira project. | |
*/ | |
export const testWorkflowStats = async ( | |
projectCode: string | |
): Promise<TestWorkFlowStatsResult> => { | |
const project = await readProjectById(projectCode); | |
const [stories, uiTests] = await Promise.all([ | |
readAllStories(projectCode), | |
readAllUiTests(projectCode), |