Deriving a new Array from an existing Array:
['■','●','▲'].slice(1, 3) ⟼ ['●','▲']
['■','●','■'].filter(x => x==='■') ⟼ ['■','■']
['▲','●'].map(x => x+x) ⟼ ['▲▲','●●']
['▲','●'].flatMap(x => [x,x]) ⟼ ['▲','▲','●','●']
/* eslint-disable no-unused-vars */ | |
/* eslint-disable no-else-return */ | |
// JSX constructor, similar to createElement() | |
export const h = (type, props, ...children) => { | |
return { | |
type, | |
// Props will be an object for components and DOM nodes, but a string for | |
// text nodes | |
props, |
/** | |
* The target language. [Browser support is good][1] but "en-US" is a safe default. | |
* | |
* [1]: https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/language | |
* | |
* @type {string} | |
*/ | |
const { language = "en-US" } = navigator; | |
/** |
# I use ZSH, here is what I added to my .zshrc file (config file) | |
# at ~/.zshrc | |
# ------------------ Android ------------------ # | |
# Have the adb accessible, by including it in the PATH | |
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:path/to/android_sdk/platform-tools/" | |
# Setup your Android SDK path in ANDROID_HOME variable | |
export ANDROID_HOME=~/sdks/android_sdk |
# ANGULAR | |
SPACESHIP_ANGULAR_SHOW="${SPACESHIP_ANGULAR_SHOW:=true}" | |
SPACESHIP_ANGULAR_PREFIX="${SPACESHIP_ANGULAR_PREFIX:="with "}" | |
SPACESHIP_ANGULAR_SUFFIX="${SPACESHIP_ANGULAR_SUFFIX:="$SPACESHIP_PROMPT_DEFAULT_SUFFIX"}" | |
SPACESHIP_ANGULAR_SYMBOL="${SPACESHIP_ANGULAR_SYMBOL:="🅰️ "}" | |
SPACESHIP_ANGULAR_DEFAULT_VERSION="${SPACESHIP_ANGULAR_DEFAULT_VERSION:=""}" | |
SPACESHIP_ANGULAR_COLOR="${SPACESHIP_ANGULAR_COLOR:="red"}" | |
SPACESHIP_ANGULAR_CLI_SHOW="${SPACESHIP_ANGULAR_CLI_SHOW:=true}" | |
SPACESHIP_ANGULAR_CLI_PREFIX="${SPACESHIP_ANGULAR_CLI_PREFIX:=""}" |
/^(?!(corn|bread)$).+/.test('corn') // false (blacklisted) | |
/^(?!(corn|bread)$).+/.test('bread') // false (blacklisted) | |
/^(?!(corn|bread)$).+/.test('cornbread') // true (not blacklisted) | |
/^(?!(corn|bread)$).+/.test('corndog') // true (not blacklisted) | |
/^(?!(corn|bread)$).+/.test('read') // true (not blacklisted) |
module.exports = { | |
meta: { | |
docs: { | |
description: 'requires a TODO to be specified either with a task number or URL and a message', | |
category: 'Best Practices', | |
recommended: true | |
}, | |
schema: [] | |
}, |
Requirements: | |
Operating System: Ubuntu 16.04 LTS | |
Android Developer Tools (ADT) installed | |
Steps: | |
Make sure that you have connected your Android device in USB Debugging mode | |
Press Ctrl + Alt + T for Terminal and use the following command: | |
lsusb |
Please see the original article for a full explanation. Please feel free to comment, question and criticize there as well!
Requires https://www.npmjs.com/package/simple-free-encryption-tool