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
{ | |
"html": { | |
"snippets": { | |
"!!": "{<!DOCTYPE html>}>html[lang='${lang}']>(head>meta[charset='${charset}']+meta[http-equiv='X-UA-Compatible'][content='IE=edge']+meta[name='viewport'][content='width=device-width,initial-scale=1.0']+link:css+title>{${title}${1}})+(body>(header>h1>{${title}})+(main>h2>{Page Title})+(footer>p>{©})+script:src)", | |
"nav:3": "nav>a.navlink[href='#']*3>{Link $}", | |
"nav:4": "nav>a.navlink[href='#']*4>{Link $}" | |
} | |
} | |
} |
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
import { useState } from 'react'; | |
export default function Form() { | |
const [firstName, setFirstName] = useState(''); | |
const [age, setAge] = useState(''); | |
const ageAsNumber = Number(age); | |
// ... | |
return ( | |
<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
const app = { | |
pages: [], | |
show: new Event('show'), | |
init: function(){ | |
app.pages = document.querySelectorAll('.page'); | |
app.pages.forEach((pg)=>{ | |
pg.addEventListener('show', app.pageShown); | |
}) | |
document.querySelectorAll('.nav-link').forEach((link)=>{ |
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
const APP = { | |
//call the APP.urls.base to see the contents of APP.urls | |
urls: { | |
base: 'https://swapi.dev/api/', | |
people: 'people/', | |
planets: 'planets/', | |
films: 'films/', | |
species: 'species/', | |
vehicles: 'vehicles/', | |
starships: 'starships/', |
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
[ | |
{ | |
"uuid": "a1b2c3d4-e5f6-g7h8-i9j0k1l2m3n4", | |
"name": "Sterling Archer", | |
"show": "Archer", | |
"voice_actor": "H. Jon Benjamin" | |
}, | |
{ | |
"uuid": "b2c3d4e5-f6g7-h8i9-j0k1l2m3n4o5", | |
"name": "Leela", |
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
"use strict"; | |
const express = require("express"); | |
const app = express(); | |
const apples = require("./routes/apples"); | |
const port = process.env.port || 4040; | |
app.set("views", "./views"); | |
app.set("view engine", "pug"); | |
app.set("custom", "Mandalorian"); | |
app.locals.ihave = "spoken"; //lifetime of application |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Cache Storage</title> | |
<link rel="stylesheet" href="./css/main.css" /> | |
<script type="module" src="./js/main.js"></script> | |
</head> | |
<body> |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Putting User Input into JS Objects</title> | |
<style> | |
.formBox{ | |
padding: 0.5rem 2rem; |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>MultiLingual</title> | |
<style> | |
button { |
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 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>404</title> | |
<link rel="stylesheet" href="main.css" /> | |
<style> | |
html { |