Skip to content

Instantly share code, notes, and snippets.

View bradtaniguchi's full-sized avatar
😌
Developing

Brad bradtaniguchi

😌
Developing
View GitHub Profile
const PACKAGEPRODUCTS = [
{ packagename: "Package 1" },
{
productlist: [
{ productname: "product1" },
{ productname: "product2" },
{ productname: "product3" }
]
},
{ packagename: "Package 2" },
@bradtaniguchi
bradtaniguchi / quick-promise-logic.js
Last active February 18, 2020 23:02
quick example of reduce + async/await performance
const datas = [500,1000,2000];
const delay = time => new Promise(resolve => setTimeout(resolve, time));
(async () => {
console.time('timer');
console.log('sum', await datas.reduce(async (sum, data) => {
await delay(data);
console.log('done with', data);
class Thermostat {
constructor(temperature) {
this._temperature = temperature;
}
// getter
get temperature() {
return this._temperature;
}
// setter
set temperature(updated) {
'use strict';
const express = require('express');
const bodyParser = require('body-parser');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
const session = require('express-session');
const passport = require('passport');
const mongo = require('mongodb').MongoClient;
const ObjectID = require('mongodb').ObjectID;
const LocalStrategy = require('passport-local');
function myFunc() {
switch (card) {
case 2:
case 3:
case 4:
case 5:
case 6:
return count + 1;
break;
case 10:
@bradtaniguchi
bradtaniguchi / graphing-problem-notes.md
Last active July 23, 2020 19:15
Notes for a graphing problem

Graphing Problem Notes

These are notes for a problem I'm running into, just to get thoughts down, and potentially get help in solving this problem.

Generic Problem

Given an array of nodes with the following properties:

  • id {number} - the unique id of this node
  • parents {number[]} - list of ids that are this nodes "parents". If empty, this node "child is a child.
@bradtaniguchi
bradtaniguchi / graphing-problem-notes.md
Created July 23, 2020 19:15
Notes for a graphing problem

Graphing Problem Notes

These are notes for a problem I'm running into, just to get thoughts down, and potentially get help in solving this problem.

Generic Problem

Given an array of nodes with the following properties:

  • id {number} - the unique id of this node
  • parents {number[]} - list of ids that are this nodes "parents". If empty, this node "child is a child.
@bradtaniguchi
bradtaniguchi / test.md
Created January 2, 2021 22:53
test.md

23 = 8

[
{
"2021-02-12:3":{
"260.0":[
{
"putCall":"CALL",
"symbol":"SQ_021221C260",
"description":"SQ Feb 12 2021 260 Call (Weekly)",
"exchangeName":"OPR",
"bid":3.85,
import { HttpErrorResponse, HttpEvent } from '@angular/common/http';
import { Observable, of, throwError } from 'rxjs';
import { delay, mergeMap, retryWhen } from 'rxjs/operators';
/**
* Taken from:
* https://medium.com/angular-in-depth/retry-failed-http-requests-in-angular-f5959d486294
*
* Retry with exponential back-off.
* Defaults