whichMan.sh "some string that may appear in some package's manpage"
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
const scale = { | |
c: 0, | |
'c#': 1, | |
d: 2, | |
'd#': 3, | |
e: 4, | |
f: 5, | |
'f#': 6, | |
g: 7, | |
'g#': 8, |
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
const pluralize = (n, [singular, plural]) => (n === 1 ? `${n} ${singular}` : `${n} ${plural}`); | |
const translateBiggestUnit = ( | |
n, | |
[divisor, ...divisors], | |
[unit, ...units], | |
candidateDivisor, | |
divisorsUsed, | |
unitsUsed, | |
) => { |
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
// Flatten an array of nodes, returning all nodes | |
// of the tree without their children. | |
const flattenNodeTree = (node) => { | |
const { children, ...otherProps } = node; | |
if (!children) { | |
return [{ ...otherProps }]; | |
} | |
return [{ ...otherProps }, ...[].concat(...children.map(flattenNodeTree))]; |
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
{"lastUpload":"2021-04-28T11:12:04.357Z","extensionVersion":"v3.4.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
#!/usr/bin/env bash | |
nDevices="0" | |
nTries="0" | |
echo "Looking for connected Android devices..." | |
echo "" | |
while [ $nDevices -lt 1 ] | |
do |
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
#include "exampleScenes.h" | |
HelloWorldScene::HelloWorldScene(): | |
Scene( | |
Screen(1000, 800), | |
Camera(-800, 100, 100, 80) | |
) | |
{ | |
add( | |
new RectangleShape( |
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
const digits = [0, 1, 2, 5, 8] | |
const isAmbiNumber = (number) => { | |
// return true if all digits of number are in digits array | |
const digitsOfNumber = number.toString().split(''); | |
return digitsOfNumber.every(digit => digits.includes(parseInt(digit))); | |
} | |
const isPalindrome = (string) => { | |
const reversed = string.split('').reverse().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
#!/bin/env bash | |
target="$1" | |
if ! [ -d "$target" ]; then | |
echo "Usage: $0 <directory>" | |
exit 1 | |
fi | |
#supposed capacity of the disk in GB |