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 withExec() { | |
| const scopesExpression = /\/scopes\/([0-9]*)/g; | |
| const { 1: scopeId1 } = scopesExpression.exec("/scopes/1234"); | |
| const { 1: scopeId2 } = scopesExpression.exec("/scopes/5678"); | |
| return [scopeId1, scopeId2]; | |
| // Uncaught TypeError: Cannot destructure 'undefined' or 'null'. | |
| } | |
| function withMatch() { |
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
| #!/bin/bash | |
| # | |
| # Watch current directory (recursively) for file changes, and execute | |
| # a command when a file or directory is created, modified or deleted. | |
| # | |
| # Written by: Senko Rasic <[email protected]> | |
| # | |
| # Requires Linux, bash and inotifywait (from inotify-tools package). | |
| # | |
| # To avoid executing the command multiple times when a sequence of |
This works with Twitch URLs also.
streamlink "https://www.youtube.com/watch?v=Gssol4R3yMg" "best" -o "OUTPUT_NAME.avi"
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
| // | |
| // Regular Expression for URL validation | |
| // | |
| // Author: Diego Perini | |
| // Created: 2010/12/05 | |
| // Updated: 2018/09/12 | |
| // License: MIT | |
| // | |
| // Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
| // |
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
| tf_mm_servermode 0 //Matchmaking |0 = not active|1 = Put in matchmaking pool | |
| tf_mm_strict 2 //0 = Show in browser, and allow ad-hoc|1 = Hide from browser and only allow joins through matchmaking|2 = Hide from browser, but allow ad-hoc joins |
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 foldBy(constructor, arr) { | |
| if (!arr.length) return null; | |
| const [item, ...rest] = arr; | |
| return constructor(item, foldBy(constructor, rest)); | |
| } |
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
| /* | |
| TODO: Change API to make `paths` an array of strings | object | |
| */ | |
| const pickAs = (obj, paths) => { | |
| return Object.entries(paths).reduce((accumulator, [path, definition]) => { | |
| const resultValue = get(obj, path); | |
| if (definition === true) { | |
| accumulator[path] = resultValue; | |
| } else if (isFunction(definition)) { |
Convert Markdown image link to HTML <img> with resize percent:
const resizeMdImg = (mdImgStr, size) => {
if (!mdImgStr) return;
const mdImgExpression = /^!\[(.*)\]\((.*)\)/;
const { 1: alt, 2: src } = mdImgStr.match(mdImgExpression);
const sizeStr = size ? ` height="${size}" width="${size}"` : "";0:58 ──♤───── 3:47
↻ ◁ II ▷ ↺
ılı.lıllılı.ıllı....llı.........lıl..lı.................
ᴠᴏʟᴜᴍᴇ : ▮▮▮▮▮▮▯▯▯