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
import { EventEmitter } from 'node:events'; | |
function createHttpModuleMock() { | |
const _requests = []; | |
const mockInstance = { | |
request(url, options, callback) { | |
return _requests[_requests.push(new HttpRequestMock(url, options, callback)) - 1]; | |
}, | |
get _lastRequest() { |
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/bash | |
# This script check the spell of your commit message saving | |
# using LanguageTool service (https://languagetool.org/). | |
# | |
# To use it, you register an account in LanguageTool service, | |
# than go to "Settings -> Account -> Access Tokens" and click | |
# "Create Integration Key". Copy your email and key and paste | |
# them into this scrip into the corrsponsing variables (LT_EMAIL, | |
# LT_API_KEY). |
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/bash | |
# Output sample | |
# ========================= Total coverage diff summary ========================== | |
# lines : +0.46% ( +33 ) | |
# statements : +0.49% ( +36 ) | |
# functions : +0.66% ( +17 ) | |
# branches : +0.16% ( +4 ) | |
# ================================================================================ |
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
acceptSuggestionOnEnter | |
accessibilityHelpWidgetVisible | |
accessibilityModeEnabled | |
activeEditor == 'WebviewEditor' | |
activeEditor == 'workbench.editor.extension' | |
activeEditorGroupEmpty | |
activePanel == 'refactorPreview' | |
atEndOfWord | |
breadcrumbsActive | |
breadcrumbsPossible |
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
import React, {PureComponent, ReactNode, ReactNodeArray} from 'react'; | |
import { | |
formColumn12, | |
formColumn2, | |
formColumn3, | |
formColumn4, | |
formColumn5, | |
formColumn6, | |
formColumn8, | |
rightFormColumn |
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
import range from 'degiro-frontend-core/lib/utils/range'; | |
import React, {PureComponent} from 'react'; | |
import {NavLink} from 'react-router-dom'; | |
import {paginationLink, paginationLinkActive, paginationList, paginationListItem} from './pagination.css'; | |
interface PaginationProps { | |
/** | |
* Total amount of items | |
*/ | |
itemsTotal: 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
function distance(p1, p2) { | |
// radius of the sphere (Earth) in meters | |
const rad = 6372795; | |
// coordinates of two points | |
const {lat: llat1, long: llong1} = p1; | |
const {lat: llat2, long: llong2} = p2; | |
// in radians | |
const lat1 = llat1 * Math.PI / 180; |
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 pluralize(quantity, options) { | |
/** | |
* options: [ | |
* 0 -> товар | |
* 1 -> товара | |
* 2 -> товаров | |
* ] | |
*/ | |
const remainder = (quantity %= 100, quantity > 14 ? quantity % 10 : quantity); | |
return options[remainder === 1 ? 0 : remainder > 1 && remainder < 5 ? 1 : 2]; |
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
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir="C:\Users\roman.charugin\AppData\Roaming\Google\Chrome\User Data" --remote-debugging-port=9222 --no-first-run --no-default-browser-check --auto-open-devtools-for-tabs |
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
/** | |
* Format size in bytes in a human-readable way | |
* Examples: | |
* - humanReadableBytes(9708) → "9.48 KB" | |
* - humanReadableBytes(9708098213) → "9.04 GB" | |
* @param bytes Amount in bytes | |
* @return Formatted price | |
*/ | |
function humanReadableSize(bytes: number): string { | |
const names: string[] = ['B', 'KB', 'MB', 'GB', 'TB', 'PB']; |
NewerOlder