Skip to content

Instantly share code, notes, and snippets.

View FermiDirak's full-sized avatar
🚴
gone cycling

Bryan Manuele FermiDirak

🚴
gone cycling
View GitHub Profile
@FermiDirak
FermiDirak / PascalsTriangle.js
Last active January 25, 2018 17:26
Pascal's Triangle in JS
/**
* Generates Pascal's triangle
* @param {number} numRows
* @return {number[][]} Pascal's Priangle
*/
var generate = function(numRows) {
var pascalsTriangle = [];
//initial value at top of triangle
if (numRows >= 1) {
@FermiDirak
FermiDirak / largest-level-of-tree.js
Created February 8, 2018 17:32
Largest Row in a Tree Solution
var Tree = function(value) {
this.value = value;
this.children = [];
}
Tree.prototype.addChild = function(value) {
this.children.push(new Tree(value));
}
/**
@FermiDirak
FermiDirak / pathToSum.js
Last active February 22, 2018 17:32
Path to Sum for Binary Search Trees
const hasPathToSum = function(node, targetSum) {
var sum = 0;
while(sum !== targetSum) {
if (!node) {
break;
}
sum += node.datum;
GET http://localhost:3000/business/--9e1ONYQuAa-CB_Rrw7Tw
Sample Output:
{
"id": "--9e1ONYQuAa-CB_Rrw7Tw",
"name": "Delmonico Steakhouse",
"neighborhood": "The Strip",
"address": "3355 Las Vegas Blvd S",
"city": "Las Vegas",
import React from 'react';
import { shallowToJson } from 'enzyme-to-json';
import { CarouselImage } from './../../client/src/components/CarouselImage.jsx';
describe('<CarouselImage/>', () => {
let component = shallow(<CarouselImage/>);
it('should render', () => {
expect(shallowToJson(component)).toMatchSnapshot();
FROM node:latest
LABEL maintainer Bryan Manuele <[email protected]>
RUN mkdir -p /src/app
WORKDIR /src/app
COPY . /src/app
/**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
* this.left = this.right = null;
* }
*/
/**
* @param {TreeNode} root
* @param {number} k
Cash Register API
database:
Items Table:
* id INT (index)
* price MONEY
* name STRING (natural language index)
* SKU INT
* PPU MONEY
* Taxable BOOL
<link rel="canonical">
class TicTacToe {
constructor() {
this.board = [
['-', '-', '-'],
['-', '-', '-'],
['-', '-', '-'],
];
this.currentPlayer = 'x';