Skip to content

Instantly share code, notes, and snippets.

View jordangarcia's full-sized avatar

Jordan Garcia jordangarcia

View GitHub Profile
@jordangarcia
jordangarcia / jsbin.kubosudi.css
Created June 5, 2014 22:04
Example of drag and drop using Hammer.js
.box {
padding: 5px;
background: red;
margin: 10px;
position:relative;
z-index: 3;
}
.drag-target {
background: blue;
z-index: 1;
/* 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',
const promise = new Promise2((resolve, reject) => {
setTimeout(() => {
resolve('hello')
}, 500)
})
promise.then((value) => {
console.log(value)
})

Authentication

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

Endpoints

GET /user/kv

Returns a mapping of all key values for that user

User Experiment KV API

GET /account/kv

{
  [key]: value
  [key]: value
  [key]: value
  [key]: value

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

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]);
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 = {
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 = {

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}