Rx.Observable.merge/concat examples for SitePoint's 10 Fundamental Functions from RxJS.
This file contains hidden or 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
<div id="score">Press UP</div> | |
<div id="controls"> | |
<div id="buttons"> | |
<button id="accelerate"> | |
<svg width="30" height="30" viewBox="0 0 10 10"> | |
<g transform="rotate(0, 5,5)"> | |
<path d="M5,4 L7,6 L3,6 L5,4" /> | |
</g> | |
</svg> |
This file contains hidden or 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
<!-- 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> |
This file contains hidden or 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 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); |
This file contains hidden or 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
// 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); | |
} | |
}); |
This file contains hidden or 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
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 |
This file contains hidden or 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() { | |
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") | |
}; |
This file contains hidden or 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
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>'; |