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
# Cobbled together ("untested") demonstration code - no production value | |
# The intention is to flood all CPU cores with "work" | |
# | |
# Created for: https://elixirforum.com/t/finding-vampire-numbers/25098/10 | |
# | |
defmodule Primes do | |
require Integer | |
@primes :primes | |
@init_last 3 |
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
<!-- file: src/DisclosureToggle.svelte --> | |
<svelte:options tag={ null }/> | |
<script> | |
import { onMount } from 'svelte'; | |
// prop names ("buttonLabel") aren't converted to | |
// attribute names ("button-label") | |
export let label = 'Toggle content'; | |
let trigger; |
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-us"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Filter Map</title> | |
</head> | |
<body> | |
<script> |
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 log(value) { | |
console.log(value); | |
} | |
function executor(resolve, _reject) { | |
const resolveValue = () => resolve('3 Resolved now'); | |
self.setTimeout(resolveValue, 1000); | |
} | |
const pending = new Promise(executor); |
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="eng"> | |
<!-- | |
"A progressive disclosure component" | |
https://hankchizljaw.com/wrote/a-progressive-disclosure-component/ | |
with wickedElements | |
https://github.com/WebReflection/wicked-elements |
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="eng"> | |
<head> | |
<meta charset="utf-8"/> | |
<title>useCallback alternative BEFORE</title> | |
</head> | |
<body> | |
<script type="module"> | |
import { | |
html, render, useState, useCallback |
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._log('ECMAScript 2015 - with classes but no modules'); |
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="eng"> | |
<!-- | |
Based on: Getting Your Head Around Vue.js Scoped Slots - Anthony Gore | |
https://vuejsdevelopers.com/2017/10/02/vue-js-scoped-slots/ | |
https://codepen.io/anthonygore/pen/zExPZX | |
--> | |
<head> | |
<meta charset="utf-8"/> | |
<title>"Slots" in Preact using children prop</title> |
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="eng"> | |
<!-- | |
--> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Transform Benchmark</title> | |
<style> | |
p { | |
font: 1.25em monospace; |
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-us"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>itertools.permutations in vanilla JavaScript</title> | |
</head> | |
<body> | |
<p>Check Developer Tools Console (Chrome) or Web Developer Web Console (Firefox) </p> |