Skip to content

Instantly share code, notes, and snippets.

View maximkott's full-sized avatar
💭
☕️ + 🍕 + 🍺 = 1100 1010 0011

Maxim Kot maximkott

💭
☕️ + 🍕 + 🍺 = 1100 1010 0011
View GitHub Profile
#!/usr/bin/env bash
source "helpers"
SCRIPT_PATH=${0%/*}
SCRIPT_NAME=${0##*/}
# @help Parse given arguments and match them
# to local variables.
# @usage parse <args...>
parse() {
@maximkott
maximkott / mask.js
Last active April 15, 2024 20:43
mask a string in javascript
export const maskString = (
value: any,
mask: string,
maskPatterns: Record<string, RegExp | ((char: string) => boolean)>
) => {
value = value || '';
mask = mask || '';
maskPatterns = maskPatterns || {};
let maskedValue = '';
var IBAN_MASKS = {
'default': 'SSSS SSSS SSSS SSSS SSSS SSSS SSSS SSSS',
'AD': 'SSSS SSSS SSSS SSSS SSSS SSSS',
'AL': 'SSSS SSSS SSSS SSSS SSSS SSSS SSSS',
'AT': 'SSSS SSSS SSSS SSSS SSSS',
'BA': 'SSSS SSSS SSSS SSSS SSSS',
'BE': 'SSSS SSSS SSSS SSSS',
'BG': 'SSSS SSSS SSSS SSSS SSSS SS',
'CH': 'SSSS SSSS SSSS SSSS SSSS S',
'CY': 'SSSS SSSS SSSS SSSS SSSS SSSS SSSS',
@maximkott
maximkott / App.tsx
Last active February 20, 2020 12:24
import React, { FC } from "react"
import { ConfirmationDialogs, confirmDialog } from "./ConfirmationDialogs"
export type AppProps = {}
export const App: FC<AppProps> = (props) => {
const deleteWithConfirmation = async () => {
const confirmation = await confirmDialog({
title: () => "Are you sure?",
})