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>Document</title> | |
<script> | |
class Blah extends HTMLElement { | |
constructor() { | |
super(); |
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>Promises</title> | |
<script> | |
document.addEventListener('DOMContentLoaded', init); | |
function init() { |
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>Pagination</title> | |
<style> | |
* { | |
box-sizing: border-box; | |
font-weight: 300; |
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>Events</title> | |
<style> | |
body { | |
font-family: sans-serif; | |
padding: 0; |
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>CSP</title> | |
<meta http-equiv="content-security-policy" content="default-src 'self'; " /> | |
<link rel="shortcut icon" href="" /> | |
<link rel="preconnect" href="https://fonts.googleapis.com" /> | |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> |
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 log = console.log; | |
function List(_values) { | |
//create a List object | |
if (!Array.isArray(_values)) return; | |
//exit the function if not given an array | |
this.items = [..._values]; //copy the array values into a property called items | |
this.size = this.items.length; | |
this.first = this.items.length > 0 ? this.items[0] : undefined; | |
this.last = this.items.length > 1 ? this.items[this.items.length - 1] : undefined; |
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 characters = [ | |
{ | |
name: 'Scooby-Doo', | |
role: 'Dog', | |
personality: 'Cowardly but brave when it matters', | |
uuid: '550e8400-e29b-41d4-a716-446655440000', | |
}, | |
{ | |
name: 'Shaggy Rogers', | |
role: 'Best Friend of Scooby-Doo', |
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
//copy = Array.prototype.with(index, value) | |
//changed = Array.prototype.copyWithin(index, start, end) | |
const names = ['Bob', 'Louise', 'Gene', 'Linda', 'Teddy']; | |
const newNames = names.with(1, 'Gayle'); // names[1] = 'Gayle' | |
console.log(names); | |
console.log(newNames); | |
console.log(names == newNames); //false | |
console.log(names === newNames); //false |
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>SVG Progress Display for File Downloads</title> | |
<style> | |
:root { | |
--bgcolor: hsl(220, 20%, 70%); | |
--focuscolor: hsl(220, 80%, 50%); |
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
{ | |
"categories": ["historical fiction", "science fiction", "fantasy", "romance", "non-fiction", "programming", "classic"], | |
"books": [ | |
{ "id": "cc196ef3-431f-4238-8aea-8a94e73229a4", "category": "science fiction", "title": "the 3 body problem", "author": "cixin lin" }, | |
{ "id": "e2fd5989-6908-45c5-91db-d6e561fc8b8b", "category": "fantasy", "title": "the hobbit", "author": "j.r.r. tolkien" }, | |
{ "id": "ee69e09a-61f0-4c19-bbbc-826399f678c4", "category": "programming", "title": "web developers practical guide to flutter", "author": "steve griffith" }, | |
{ "id": "dbc27431-33b4-49fb-82a4-1ab9bea0f26a", "category": "classic", "title": "moby dick", "author": "herman melville" }, | |
{ "id": "ef78671c-d518-468c-bfdf-4786c3a03c19", "category": "non-fiction", "title": "superintelligence", "author": "nick bostrom" } | |
] | |
} |
NewerOlder