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
/* | |
Implement a Queue data structure using two stacks. | |
- Do not create an array inside of the 'Queue' class. | |
- Queue should implement the methods 'add', 'remove', and 'peek'. | |
*/ | |
class Stack { | |
constructor() { | |
this.data = []; | |
} |
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
/* | |
Implement the 'weave' function. | |
- Weave receives two queues as arguments and combines the contents of each into a new, third queue | |
- The third queue should contain the alternating content of the two queues | |
- The function should handle queues of different lengths without inserting 'undefined' into the new one | |
- Do not access the array inside of any queue, only use the add, remove, and peek functions |
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
// Iterative Fib (Linear runtime) | |
function fibItr(n) { | |
const result = [0, 1]; | |
for (let i = 2; i <= n; i++) { | |
const a = result[n - 1]; | |
const b = result[n - 2]; | |
result.push(a + b); | |
} |
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
// matrix(3); | |
// [[1, 2, 3], | |
// [8, 9, 4], | |
// [7, 6, 5]] | |
// matrix(4); | |
// [[1, 2, 3, 4], | |
// [12, 13, 14, 5], | |
// [11, 16, 15, 6], | |
// [10, 9, 8, 7]] |
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
[ | |
{ | |
"name": "dynamic0020", | |
"value": "dynamic0020" | |
}, | |
{ | |
"name": "dynamic0050", | |
"value": "dynamic0050" | |
}, | |
{ |
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 { getStore } from './store'; | |
import { Provider } from 'react-redux'; | |
import Component from './components/Component' | |
const App = () => { | |
const store = getStore() | |
return ( | |
<Provider store={store}> |
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
{ | |
"blogposts": [] | |
} |
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
const fs = require('fs'); | |
const keys = require('../config/keys'); | |
const { Translate } = require('@google-cloud/translate').v2; | |
const translate = new Translate({ | |
projectId: keys.googleProjectKey, | |
keyFilename: '../google_authentication.json' | |
}); |
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, { PureComponent } from 'react'; | |
import PropTypes from 'prop-types'; | |
export default class ClampLines extends PureComponent { | |
constructor(props) { | |
super(props); | |
this.element = null; | |
this.original = props.text; | |
this.watch = true; |
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 { connect } from 'react-redux'; | |
import { fetchAdmins } from '../actions'; | |
import requireAuth from '../components/hocs/requireAuth'; | |
class AdminsListPage extends Component { | |
componentDidMount() { | |
this.props.fetchAdmins(); | |
} |