Skip to content

Instantly share code, notes, and snippets.

Avatar

Jordan Garcia jordangarcia

View GitHub Profile
View request.js
/* eslint-disable prefer-promise-reject-errors */
/* eslint-disable compat/compat */
import $ from 'jquery';
import lumin from '../constants/lumin';
const contentType = { 'Content-Type': 'application/json' };
export const ajaxRequest = function (
endpoint = '',
method = 'get',
View promise.js
const promise = new Promise2((resolve, reject) => {
setTimeout(() => {
resolve('hello')
}, 500)
})
promise.then((value) => {
console.log(value)
})
View api.md

Authentication

Must supply Authorization: Bearer ${token} as a header

Endpoints

GET /user/kv

Returns a mapping of all key values for that user

View api.md

User Experiment KV API

GET /account/kv

{
  [key]: value
  [key]: value
  [key]: value
  [key]: value
View fe-challenge.md

Timer Challenge

Create a timer that counts upwards. Starting at 00:00 and counts up every second.

There should be two buttons when the timer is first rendered

MOCK

00:00

View michael.js
import React, { useEffect, useState } from "react";
import { Flex, Title, Button } from "../../design/components";
import { Link } from "react-router-dom";
export default function Michael(props) {
const [greeting, setGreeting] = useState("initialValue");
useEffect(() => {
alert("greeting changed");
}, [greeting]);
View theme.js
import icons from "./icons";
const breakpoints = ["480px", "900px", "1025px", "1280px"];
// TODO should this be `small` medium and large
breakpoints.sm = breakpoints[0];
breakpoints.med = breakpoints[1];
breakpoints.lg = breakpoints[2];
const colors = {
View theme.js
import icons from "./icons";
const breakpoints = ["480px", "900px", "1025px", "1280px"];
// TODO should this be `small` medium and large
breakpoints.sm = breakpoints[0];
breakpoints.med = breakpoints[1];
breakpoints.lg = breakpoints[2];
const colors = {
View pubsub.md

Technical Question

Create a simple pub/sub system using webhooks. It will require you to create two servers, a publisher and a subscriber.

Publisher Server Requirements

  1. publish a payload to topic
  2. subscribe to a topic to receive payloads

POST /publish/{topic}

View pubsub.md

Technical Question

Create a simple pub/sub system using webhooks. It will require you to create two servers, a publisher and a subscriber.

Publisher Server Requirements

  1. publish a payload to topic
  2. subscribe to a topic to receive payloads

POST /publish/{topic}

You can’t perform that action at this time.