Skip to content

Instantly share code, notes, and snippets.

customElements.define('ajax-html', class extends HTMLElement {
/**
* The class constructor object
*/
constructor () {
// Always call super first in constructor
super();
customElements.define('ajax-form', class extends HTMLElement {
/**
* The class constructor object
*/
constructor () {
// Always call super first in constructor
super();
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Loop + String</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
body {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Ecommerce Platform</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
body {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Ecomerce Platform</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
body {
@cferdinandi
cferdinandi / index.jquery.html
Last active January 24, 2025 19:44
Watch the tutorial for this source code at https://www.youtube.com/watch?v=TnQ0ooEMRqc
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Lettering.js Examples</title>
<meta name="description" content="A jQuery Plugin that allows you to style each individual letter and more.">
<meta name="author" content="Dave Rupert">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Mocha Tests</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://unpkg.com/mocha/mocha.css" />
</head>
<body>
<div id="mocha"></div>
const calculator = (function () {
/**
* Remove non-numeric strings from the array
* @param {Array} nums The original array
* @return {Array} The cleaned array
*/
function cleanNumbers (nums) {
let cleaned = [];
for (let num of nums) {
const calculator = (function () {
/**
* Add two or more numbers together
* @param {...Numbers} nums The numbers to add together
* @return Number The total
*/
function add (...nums) {
let total = 0;
for (let num of nums) {
const calculator = (function () {
/**
* Add two or more numbers together
* @param {...Numbers} nums The numbers to add together
* @return Number The total
*/
function add (...nums) {
let total = nums.length ? nums.shift() : 0;
for (let num of nums) {