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
class BuildingBlock extends React.Component {
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
}
handleClick() {
console.log('click!');
}
class TicTacToe {
constructor() {
this.board = [
['-', '-', '-'],
['-', '-', '-'],
['-', '-', '-'],
];
this.currentPlayer = 'x';
<link rel="canonical">
Cash Register API
database:
Items Table:
* id INT (index)
* price MONEY
* name STRING (natural language index)
* SKU INT
* PPU MONEY
* Taxable BOOL
/**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
* this.left = this.right = null;
* }
*/
/**
* @param {TreeNode} root
* @param {number} k
FROM node:latest
LABEL maintainer Bryan Manuele <[email protected]>
RUN mkdir -p /src/app
WORKDIR /src/app
COPY . /src/app
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();
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",
@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;
@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));
}
/**