This file contains hidden or 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
<% _.forEach(env, function(v, k) { %> | |
global.___ENV__['<%= k %>'] = '<%= v %>'; | |
<% }) %> |
This file contains hidden or 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 hasPairOfSum(arr, sum){ | |
var flag; | |
for(let i=0;i<arr.length;i++) { | |
if (flag === arr[i]) { return true; } | |
else if (arr[i] !== sum/2) { continue; } | |
else if(!flag) { flag = arr[i]; } | |
} | |
return false; | |
} |
This file contains hidden or 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 jsonToFirebaseJSON(arr) { | |
const result = arr.reduce((acummulator, current, index) => | |
(Object.assign({}, acummulator, {[index]: current})), {}); | |
return JSON.stringify(result); | |
} | |
// index can be replaced with your id/primary key |
This file contains hidden or 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
// you can write to stdout for debugging purposes, e.g. | |
// console.log('this is a debug message'); | |
function solution(A) { | |
// write your code in JavaScript (Node.js 6.4.0) | |
let len = A.length | |
let arr = new Array(len) | |
for(let i=0; i<len;i++) { | |
let idx = A[i] - 1 |
This file contains hidden or 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 solution(S) { | |
const openBrackets = ['(', '{', '[']; | |
const closeBrackets = [')', '}', ']']; | |
let len = S.length; | |
let stack = []; | |
let counter=0; | |
if (len === 0) { return 1; } | |
if (len % 2 !== 0) { return 0; } | |
This file contains hidden or 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 solution(A, B) { | |
// write your code in JavaScript (Node.js 6.4.0) | |
let len = A.length; | |
if (len === 1) return 1; | |
let stack = []; | |
// stack.unshift(0); | |
let sum = B.reduce((a,c) => a+c, 0); | |
if (sum === 0 || sum === len) return len; | |
if (sum === 1 === B[len-1]) return len; | |
if (sum === len-1 && B[0] === 0) return len; |
This file contains hidden or 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
// you can write to stdout for debugging purposes, e.g. | |
// console.log('this is a debug message'); | |
function solution(H) { | |
// write your code in JavaScript (Node.js 6.4.0) | |
let len = H.length; | |
if (len === 1) return 1; | |
let low = 0; | |
let stack = []; | |
let tmp = 0, count=0, countB=0; |
This file contains hidden or 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 { | |
BrowserRouter as Router, | |
Route, | |
Switch | |
} from 'react-router-dom'; | |
import './App.css'; | |
import LandingPage from './LandingPage/LandingPage'; | |
import PortfolioPage from './PortfolioPage/PortfolioPage'; |
This file contains hidden or 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 from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { mount } from 'enzyme'; | |
import { MemoryRouter } from 'react-router'; | |
import LandingPage from './LandingPage/LandingPage'; | |
import NotFoundPage from './ErrorPage/NotFoundPage/NotFoundPage'; | |
import App from './App'; | |
jest.mock('firebase/app'); |
This file contains hidden or 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
{ | |
"database": { | |
"rules": "database.rules.json" | |
}, | |
"hosting": { | |
"public": "build", | |
"rewrites": [ | |
{ | |
"source": "**", | |
"function": "app" |