This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Yelp Brand Distances SOLUTION | |
description: '' | |
host: EXCEL | |
api_set: {} | |
script: | |
content: "const statusText = document.querySelector(\"#status\");\nconst form = document.querySelector(\"form\");\n\nform.addEventListener(\"submit\", handleFormSubmit);\n\nasync function handleFormSubmit(event) {\n event.preventDefault();\n\n const baseBrandRestaurants = await getRestaurants(form.baseBrand.value, form.location.value, form.apiKey.value);\n const competitorBrandRestaurants = await getRestaurants(\n form.competitorBrand.value,\n form.location.value,\n form.apiKey.value\n );\n\n statusText.textContent = `Calculating distance for ${baseBrandRestaurants.length} restaurants...`;\n baseBrandRestaurants.forEach((baseRestaurant) => {\n competitorBrandRestaurants.forEach((competitorRestaurant) => {\n // calculate the distance using lat / long and check if this one is the closest\n const distance = milesBetween(\n baseRestaurant.latitude,\n baseRestaurant.longitude,\n co |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Github API | |
description: Search for developers across markets and languages | |
host: EXCEL | |
api_set: {} | |
script: | |
content: > | |
const corsProxy = "https://rbi-tech-bootcamp-cors-proxy.herokuapp.com/"; | |
const form = document.querySelector("form"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dad Joke API Example | |
description: Very basic implementation of fetching data and putting into Excel | |
host: EXCEL | |
api_set: {} | |
script: | |
content: | | |
const button = document.querySelector("button"); | |
button.addEventListener("click", run); | |
async function getRandomDadJoke(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dad Jokes | |
description: Create a new snippet from a blank template. | |
host: EXCEL | |
api_set: {} | |
script: | |
content: "const button = document.querySelector(\"#run\");\nbutton.addEventListener(\"click\", getJoke);\n\nasync function getJoke() {\n try {\n $('#status').text('Fetching joke... \U0001F92A')\n const url = \"https://icanhazdadjoke.com/\";\n const headers = { Accept: \"application/json\" };\n const response = await fetch(url, { headers });\n const data = await response.json();\n const joke = data.joke;\n await Excel.run(async (context) => {\n $('#status').text('Displaying joke... \U0001F602')\n const sheet = context.workbook.worksheets.getActiveWorksheet();\n const range = sheet.getRange(\"A2\");\n range.values = [[joke]];\n await context.sync();\n });\n $('#status').text('Did you like it ??? \U0001F923')\n } catch (error) {\n console.error(error);\n console.error(error.message);\n }\n}\n" | |
language: typescript | |
template: | |
content: |- | |
<h1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8' /> | |
<title>USA Flag</title> | |
<style> | |
body{ | |
margin: 0; | |
color: #FFFFFF; | |
font-size: 2vw; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Equilateral | |
def assign_sides(a) | |
@side1 = a | |
@side2 = a | |
@side3 = a | |
@side4 = a | |
end | |
def equilateral_sidelength | |
@side1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Display | |
def self.showtitle | |
puts " | |
███████╗██╗ ███████╗ ██████╗████████╗██╗ ██████╗ ███╗ ██╗ | |
██╔════╝██║ ██╔════╝██╔════╝╚══██╔══╝██║██╔═══██╗████╗ ██║ | |
█████╗ ██║ █████╗ ██║ ██║ ██║██║ ██║██╔██╗ ██║ | |
██╔══╝ ██║ ██╔══╝ ██║ ██║ ██║██║ ██║██║╚██╗██║ | |
███████╗███████╗███████╗╚██████╗ ██║ ██║╚██████╔╝██║ ╚████║ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Animal | |
def initialize(animalname) | |
@name=animalname | |
end | |
def jumped_over (firstthingjumpedover, secondthingjumpedover) | |
puts "#{@name} jumped over the #{firstthingjumpedover} and the #{secondthingjumpedover}." | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "./wyncodemodules.rb" | |
WyncodeTests.float_fixer_test | |
WyncodeTests.bignum_digits_test | |
WyncodeTests.join_split_test | |
WyncodeTests.hash_genetics_test | |
WyncodeTests.class_methods_comparison_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def perpetual_NYE | |
10.downto(0).each {|i| | |
sleep 1 | |
puts i | |
} | |
perpetual_NYE | |
end |
NewerOlder