Skip to content

Instantly share code, notes, and snippets.

View jonly03's full-sized avatar

Joseph Nelly Sugu Sugira jonly03

View GitHub Profile
@jonly03
jonly03 / api-helper.js
Created December 14, 2022 23:15
90% Drive-In_Movie_Theater
import { OMDB_API_KEY, MOVIEDB_API_KEY } from "../global-constants/secret.js";
import {
NO_FOUND_MOVIE,
DEFAULT_PHOTO_URL,
} from "../global-constants/constants.js";
import { getData } from "../api/api-helper.js";
import { handleError } from "../errors/error.js";
export function getMoviesInfo(searchTerm) {
@jonly03
jonly03 / index.html
Created December 14, 2022 18:59
Drive_In_Theater_API
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Full-stack-primer</title>
<!-- Bootstrap CSS -->
<link
@jonly03
jonly03 / index.html
Created December 13, 2022 23:44
Drive-In Movie API
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Full-stack-primer</title>
<!-- Bootstrap CSS -->
<link
@jonly03
jonly03 / index.js
Created July 20, 2022 23:09
Destinations Page API (Starter code)
const express = require("express");
const server = express(); // This server is deaf
server.listen(3000); // Told the server to listen on port 3000
const destinationsDB = {
123456: {
destination: "Eiffel Tower",
location: "Paris",
photo:
@jonly03
jonly03 / helpers.js
Created July 19, 2022 20:48
Destinations Page with Unsplash NOT WAITING FOR IMAGE
export async function handleFormSubmit(evtObj) {
// Prevents form from automatically submit our info and gives us time to process input our way
evtObj.preventDefault();
// TODO - Grab user input on form submit
let destName = document.getElementById("dest_name").value;
let locName = document.getElementById("loc_name").value;
// let photoUrl = document.getElementById("photo_url").value;
// Get the photo from Unsplash API
@jonly03
jonly03 / helpers.js
Created July 19, 2022 20:01
Destinations Page with Unsplash API
export async function handleFormSubmit(evtObj) {
// Prevents form from automatically submit our info and gives us time to process input our way
evtObj.preventDefault();
// TODO - Grab user input on form submit
let destName = document.getElementById("dest_name").value;
let locName = document.getElementById("loc_name").value;
// let photoUrl = document.getElementById("photo_url").value;
// Get the photo from Unsplash API
@jonly03
jonly03 / buttons-management.js
Last active July 19, 2022 17:58
Tenor API Activity With Error Handling (using Axios)
import { createGifCards } from "./gif-rendering.js";
export function createButton(text) {
// TODO Create new button element with some of the input value
// input value: Lebron
// button text: Lebron GIF Search Button
const btnText = `${text} GIF Search Button`;
// <button></button>
const newBtn = document.createElement("button");
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>GIF API</title>
<!-- <link rel="stylesheet" href="./style.css" /> -->
</head>
@jonly03
jonly03 / helpers.js
Created July 18, 2022 20:01
Destinations Page - Unstyled
export function handleFormSubmit(evtObj) {
// Prevents form from automatically submit our info and gives us time to process input our way
evtObj.preventDefault();
// TODO - Grab user input on form submit
let destName = document.getElementById("dest_name").value;
let locName = document.getElementById("loc_name").value;
let photoUrl = document.getElementById("photo_url").value;
let descr = document.getElementById("description").value;
@jonly03
jonly03 / index.html
Created July 13, 2022 23:07
Rainbow colors
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Rainbow colors</title>
<!--
<link rel="stylesheet" href="./style.css" /> -->
</head>