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 () { | |
const timeout = 5000; | |
const start = performance.now(); | |
const interval = setInterval(() => { | |
const popup = document.querySelector('[data-testid="sheetDialog"] svg'); | |
console.log(popup); | |
if (!popup || performance.now() - start > timeout) | |
return clearInterval(interval); | |
if (popup) popup.parentElement.click(); | |
}, 100); |
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
#!/usr/bin/env sh | |
NAME='repo' | |
# abort on errors | |
set -e | |
# build | |
npm run build | |
# navigate into the build output directory |
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
let data = Array.from(document.querySelectorAll(".commands-container h2")).map( | |
(el) => { | |
return { | |
heading: el.textContent, | |
items: Array.from(el.nextElementSibling.children).map((el) => { | |
const [answers, ...description] = el.textContent | |
.trim() | |
.split(/\s+-\s+/); | |
return { | |
description: description.join(" - "), |
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
:root { | |
--background-color: whitesmoke; | |
--header-height: 2em; | |
--margin-end: 1em; | |
--margin-gap: 1px; | |
--margin-color: red; | |
--margin-right: 0.25em; |
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
def fb(cs = [3, 5], l = 100, o = 1): | |
for i in range(o, l): | |
o = "" | |
for j, c in enumerate(cs): | |
if i % c == 0: | |
o += "Fizz" if j % 2 == 0 else "Buzz" | |
print(o or i) |
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 print(arg) { | |
document.body.innerText += arg + "\n"; | |
} | |
function fizzBuzz(c = [3, 5], l = 100, o = 1) { // c = checks, l = limit, o = offset | |
return new Array(l + o) // +o because ignore zero | |
.fill(undefined) // can't map over uninitialized arrays | |
.map((_, i) => // 0 <= i < limit | |
c.reduce((a, c, j) => // a = accumulator, c = check, 0 <= j < checks.length | |
(i % c === 0) // if we've hit a Fizz/Buzz number |
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
version: '3' | |
networks: | |
reverse-proxy: {} | |
wp-test: {} | |
volumes: | |
wp-test-db: {} | |
services: |
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
<?php | |
function guardWithModulo($d, $s) | |
{ | |
return function ($i) use ($d, $s) { | |
return ($i % $d === 0) ? $s : null; | |
}; | |
} | |
$cbs = [ |
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
<?php | |
$list = <<<LIST | |
1 Introduction | |
1.1 Purpose | |
<Identify the product whose software requirements are specified in this document, including the revision or release number Describe the scope of the product that is covered by this SRS, particularly if this SRS describes only part of the system or a single subsystem.> | |
1.2 Document Conventions | |
<Describe any standards or typographical conventions that were followed when writing this SRS, such as fonts or highlighting that have special significance For example, state whether priorities for higher-level requirements are assumed to be inherited by detailed requirements, or whether every requirement statement is to have its own priority.> | |
1.3 Intended Audience and Reading Suggestions | |
<Describe the different types of reader that the document is intended for, such as developers, project managers, marketing staff, users, testers, and documentation writers Describe what the rest of this SRS contains and how it is organized Suggest a sequence for reading the document, b |
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
class NDimensionalArray extends Array { | |
constructor (size, ...sizes) { | |
super(size) | |
super.fill(undefined) | |
if (sizes.length) { | |
size = sizes.shift() | |
this.forEach((_, i) => this[i] = new NDimensionalArray(size, ...sizes)) | |
} | |
} |