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 linkchecker = (link) => { | |
//processes Links | |
let status = 200; | |
fetch(link.url).then(res => { | |
const status = res.status; | |
switch (status) { | |
case 200: | |
link.status = StatusEnum.good; | |
console.log(chalk.green(link.toString())); | |
break; |
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
// Function to create a JavaScript library name generator: | |
// generateName("dog") should return "dog.js" | |
function generateName(name) { | |
return name.endsWith('.') ? name + "js" : name + ".js"; | |
} | |
let name = "cool" | |
let library = generateName(name); | |
console.log(name, library, generateName('cool.')); |
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
https://wiki.cdot.senecacollege.ca/w/api.php?action=rsd | |
http://zenit.senecac.on.ca/~chris.tyler/planet/ | |
http://www.wordpress.com | |
http://s9y.org | |
http://en.wikipedia.org/wiki/RSS_(file_format) | |
http://en.wikipedia.org/wiki/RSS_(file_format) | |
http://en.wikipedia.org/wiki/Hackergotchi | |
http://s-aleinikov.blog.ca/feed/atom/posts/ | |
http://ejtorre.blog.ca/feed/rss2/posts/ | |
http://rickeyre.ca/open-source-feed.xml |
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
/** | |
* Encoding | |
*/ | |
const text = 'This is a sentence.'; | |
const buf = Buffer.from(text); | |
console.log({ | |
text, | |
base64: buf.toString('base64'), | |
hex: buf.toString('hex'), | |
url: encodeURIComponent(text) |
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 React from 'react'; | |
import Email from './Email'; | |
class App extends React.Component() { | |
constructor() { | |
super(); | |
this.state = { | |
name: 'First Last', | |
email: '[email protected]', | |
}; |
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
/** | |
* Image URLs of Hounds from the Dog API: | |
* https://dog.ceo/dog-api/documentation/breed | |
*/ | |
const hounds = [ | |
"https://images.dog.ceo/breeds/hound-afghan/n02088094_1003.jpg", | |
"https://images.dog.ceo/breeds/hound-afghan/n02088094_1007.jpg", | |
"https://images.dog.ceo/breeds/hound-afghan/n02088094_1023.jpg", | |
"https://images.dog.ceo/breeds/hound-afghan/n02088094_10263.jpg", | |
"https://images.dog.ceo/breeds/hound-afghan/n02088094_10715.jpg", |
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> | |
<title>Form Validation</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<!-- Load Bootstrap's CSS --> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> | |
</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> | |
<head> | |
<title>Form with CSS</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> | |
</head> | |
<body> | |
<div class="container"> |
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> | |
<title>CSS Layout Example</title> | |
<meta charset="utf-8"> | |
<!-- Deal with viewport sizing on mobile: https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag --> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- Google Fonts: 1) body text - Oswald Regular; 2) headings Cardo Regular --> |
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
window.onload = function() { | |
let src = 'https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_1MB.mp4' | |
document.body.addEventListener('click', function() { | |
// Create a source element | |
let source = document.createElement('source'); | |
// Set its src to be our video URL | |
source.src = src; | |
// Grab the video element and add the source to it | |
let video = document.querySelector('video'); |