Skip to content

Instantly share code, notes, and snippets.

View jordangarcia's full-sized avatar

Jordan Garcia jordangarcia

View GitHub Profile

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}

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} body: {payload}

const breakpoints = ["480px", "700px", "1025px", "1280px"];
// TODO should this be `small` medium and large
breakpoints.sm = breakpoints[0];
breakpoints.med = breakpoints[1];
breakpoints.lg = breakpoints[2];
const colors = {
primary: "#0c40fc",
blue: "#0c40fc",
import React from "react";
import styled from "styled-components";
import { color, typography, space } from "styled-system";
const Heading = styled.h1`
${typography}
${space}
${color}
`;
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>Horizons AJAX Async Example</title>
</head>
<body>
<h1>AJAX Async Example</h1>
// prettier-ignore
const PRODUCTS_URL = "https://horizons-school-of-technology.github.io/week02/day4/examples/products.json";
function getAllProductDetails(productUrls, callback) {
let products = [];
for (let i = 0; i < productUrls.length; i++) {
let url = productUrls[i].url;
$.ajax(url, {
success: function(productDetail) {
.title {
font-family: arial;
font-size: 46px;
font-weight: normal;
}
body {
background-color: #f7f8f9;
padding: 30px;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Horizon's first webpage</title>
</head>
<body style="background-color: #f7f8f9; padding: 30px">
<div style="background-color: white; padding: 30px 50px; border: 1px solid #cbcbcb;">
<h1 style="font-family: arial; font-size: 46px; font-weight:normal;">
Let's learn HTML
# Convert all .flac files within this folder to .wav files
find . -iname "*.flac" | wc
for flacfile in `find . -iname "*.flac"`
do
ffmpeg -i $flacfile "${flacfile%.*}.wav"
done
function ninetyNineBottles(num) {
if (num === 0) {
console.log(`No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall.`);
return;
} else if (num > 2) {
console.log(`${num} bottles of beer on the wall, ${num} bottles of beer.
Take one down and pass it around, ${num - 1} bottles of beer on the wall.`);
} else if (num === 2) {
console.log(`2 bottles of beer on the wall, 2 bottles of beer.