http://codepen.io/brandonbrule/blog/creating-a-prepoluated-pen
A Pen by Brandon Brule on CodePen.
<div class="container"> | |
<div class="page-header"> | |
<h1>JSON to Table</h1> | |
</div> | |
<div class="row"> | |
<div class="col-md-12"> | |
<div class="alert alert-info">This function requires jQuery. There is also a <a href="https://codepen.io/travishorn/pen/qXvaKa">dependency-free version</a>.</div> | |
</div> | |
<div class="col-md-6"> |
var x = document.querySelectorAll("a"); | |
var myarray = [] | |
for (var i=0; i<x.length; i++){ | |
var nametext = x[i].textContent; | |
var cleantext = nametext.replace(/\s+/g, ' ').trim(); | |
var cleanlink = x[i].href; | |
myarray.push([cleantext,cleanlink]); | |
}; | |
function make_table() { | |
var table = '<table><thead><th>Name</th><th>Links</th></thead><tbody>'; |
(function() { | |
var html = document.documentElement; | |
var buildNumberAttribute = 'data-cw-private-build-number'; | |
var masteringNumberAttribute = 'data-cw-private-mastering-number'; | |
window._BUILD_INFO_FOR_GLOBAL_ERROR_HANDLERS = { | |
buildNumber: html.getAttribute(buildNumberAttribute), | |
masteringNumber: html.getAttribute(masteringNumberAttribute), | |
locale: html.getAttribute("lang") | |
}; |
let | |
InputData = Csv.Document("a=b | |
=ab | |
ab= | |
abc☃def"), | |
Uri.UnescapeDataString = (data as text) as text => let | |
ToList = Text.ToList(data), | |
Accumulate = List.Accumulate(ToList, [ Bytes = {} ], (state, current) => | |
let |
// Catch errors since some browsers throw when using the new `type` option. | |
// https://bugs.webkit.org/show_bug.cgi?id=209216 | |
try { | |
// Create the performance observer. | |
const po = new PerformanceObserver((list) => { | |
for (const entry of list.getEntries()) { | |
// Logs all server timing data for this response | |
console.log('Server Timing', entry.serverTiming); | |
} | |
}); |
const url = new URL('http://user:pass@example.com:8080/resource/path?q=1#hash'); | |
console.log('href:', url.href); | |
console.log('protocol:', url.protocol); | |
console.log('username:', url.username); | |
console.log('password:', url.password); | |
console.log('host:', url.host); | |
console.log('hostname:', url.hostname); | |
console.log('port:', url.port); | |
console.log('pathname:', url.pathname); |
<!-- Use preprocessors via the lang attribute! e.g. <template lang="pug"> --> | |
<template> | |
<div id="app"> | |
<h2>{{date}}</h2> | |
<p>I drank {{cupsOfWater}} cups of water today 🥤</p> | |
<button @click="drinkCup">Drink a cup</button> | |
<p v-if='cupsOfWater > 0'>I drank the last cup at {{lastCup}}</p> | |
</div> | |
</template> |