Last active
March 23, 2023 11:26
Revisions
-
fobiasmog revised this gist
Mar 23, 2023 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -18,4 +18,9 @@ Get element by XPath function getElementByXpath(path) { return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; } ``` Random value on range ```js Math.floor(Math.random() * (max - min) + min) ``` -
fobiasmog revised this gist
Nov 23, 2022 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -11,4 +11,11 @@ function getResponseErrors(errors) { return flatMapDeep(errors, deep); } ``` Get element by XPath ```js function getElementByXpath(path) { return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; } ``` -
fobiasmog revised this gist
Apr 15, 2021 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,7 @@ Рекурсивное получение массива значений в хэше/дереве ```js import flatMapDeep from 'lodash/flatMapDeep' function getResponseErrors(errors) { function deep(n) { -
fobiasmog revised this gist
Apr 15, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ```js function getResponseErrors(errors) { function deep(n) { -
fobiasmog renamed this gist
Apr 15, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
fobiasmog created this gist
Apr 15, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ ``` function getResponseErrors(errors) { function deep(n) { if (typeof(n) === 'object') return flatMapDeep(n, deep); return n; } return flatMapDeep(errors, deep); } ```