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
<button id="rock">Rock</button> | |
<button id="paper">Paper</button> | |
<button id="scissors">Scissors</button> | |
<output> </output> | |
<script> | |
const buttonElements = Array.from(window.document.querySelectorAll("button")); | |
const outputElement = window.document.querySelector("output"); | |
function rps(playerChoice) { | |
const winConditions = { |
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> | |
<figure> | |
<figcaption>U.S. Population over Time</figcaption> | |
<table> | |
<thead> | |
<tr> | |
<th scope="col">Year</th> | |
<th scope="col">Population</th> | |
</tr> | |
</thead> |
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
<body> | |
<style> | |
table, | |
input, | |
textarea { | |
width: 100%; | |
} | |
</style> | |
<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
{ | |
"@context": { | |
"@vocab": "http://news.example/vocab/", | |
"news": "http://news.example/vocab/" | |
}, | |
"@type": "news:Response", | |
"articles": [ | |
{ | |
"headline": "Example headline 1", | |
"author": "Alice Jones" |
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
{ | |
"@context": { | |
"schema": "http://schema.org/", | |
"sh": "http://www.w3.org/ns/shacl#", | |
"as": "https://www.w3.org/TR/activitystreams-core/" | |
}, | |
"@type": "schema:ReadAction", | |
"schema:object": { | |
"@id": "schema:Article" | |
}, |
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" /> | |
<title>X App</title> | |
<meta name="viewport" content="width=device-width, height=device-height, viewport-fit=cover, initial-scale=1" /> | |
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> | |
<meta name="mobile-web-app-capable" content="yes" /> | |
<link rel="shortcut icon" href="icons/32x32.png" type="image/x-icon" /> |
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
<!-- | |
<h2>WC Wish List</h2> | |
<ul> | |
<li><input type=checkbox> dynamic attributes</li> | |
<li><input type=checkbox checked> if/else conditionals</li> | |
</ul> | |
--> | |
<template id="tpl-href-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
<script> | |
class XAdInner extends HTMLElement { | |
constructor() { | |
super() | |
this | |
.attachShadow({ mode: 'open' }) | |
.appendChild(window.document.getElementById('x-ad-inner-template').content.cloneNode(true)) | |
} | |
connectedCallback() { | |
window.requestAnimationFrame(() => { |
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
<script> | |
class XTimestamp extends HTMLElement { | |
constructor() { | |
super() | |
this.attachShadow({ mode: 'open' }).appendChild(window.document.createElement('slot')) | |
} | |
connectedCallback() { | |
window.requestAnimationFrame(() => { | |
this.$dateTime = this.querySelector('slot').assignedNodes()[0].innerText.trim() | |
const templateEl = window.document.createElement('template') |
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, { Component } from 'react'; | |
import { createStore, combineReducers } from 'redux'; | |
import { Provider, connect } from 'react-redux'; | |
import './App.css' | |
function TodosReducer (state, action) { | |
switch (action.type) { | |
case 'ADD_TODO': | |
var todos = state.todos ? state.todos.slice() : [] | |
todos.push(action.todo) |
NewerOlder