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
| public partial class NoBorderTabControl : TabControl | |
| { | |
| /// <summary> | |
| /// Fine-tune adjustments to hide the border more precisely. | |
| /// </summary> | |
| public Padding BorderAdjustments { get; set; } = new() | |
| { | |
| Left = 6, | |
| Right = 6, | |
| Top = 2, |
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
| import React, { ReactNode, useEffect, useState } from 'react'; | |
| interface MountControllerProps { | |
| teal?: number; | |
| leading?: number; | |
| mount: boolean; | |
| children: ReactNode; | |
| } | |
| function MountController({ children }: MountControllerProps) { |
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
| class ApiResult<T> | |
| { | |
| public ApiResult(T data) | |
| { | |
| Data = data; | |
| } | |
| public ApiResult<T> Error(string error) | |
| { | |
| Errors.Add(error); |
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
| export type SupportedLanguages = | |
| 'tr-TR' | | |
| 'ka-GE' | | |
| 'en-US' | | |
| 'ar-EG' | | |
| 'ru-RU'; | |
| ; | |
| function useDateLocalizers() { | |
| // Hooks |
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
| import { formatISO, parseISO } from "date-fns"; | |
| import { CacheKey, Deserializer, Serializer } from "json-object-mapper"; | |
| @CacheKey("DateSerializerDeserializer") | |
| class DateSerializerDeserializer implements Deserializer, Serializer { | |
| deserialize = (value: string): Date => { | |
| return parseISO(value); | |
| } | |
| serialize = (value: Date): string => { |
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
| export const INITIAL_STATE = { | |
| init: false, | |
| network: false, | |
| errors: [] as Error[], | |
| }; | |
| export type AppState = typeof INITIAL_STATE; | |
| interface INIT_STATE_TYPE { type: 'INIT_STATE' }; | |
| interface NETWORK_DOWN { type: 'NETWORK_DOWN' }; |
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
| export interface IBaseCustomMapper { | |
| fromDto(dto: any): any | Promise<any>; | |
| toDto(model: any): any | Promise<any>; | |
| } | |
| export interface BaseFormModel { | |
| getMapper(): IBaseCustomMapper; | |
| getDefaults(): BaseFormModel | Promise<BaseFormModel>; | |
| } |
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
| import ICustomerService from './ICustomerService'; | |
| class CustomerService implements ICustomerService { | |
| getCustomers(): { username: string; email: string; }[] { | |
| throw new Error("Method not implemented."); | |
| } | |
| }; | |
| export default CustomerService; |
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
| const TimeType = { Day: 1, Week: 2, Mounth: 3, Year: 4 } | |
| /** | |
| * Adds time as defined a type day, week, mounth and year to given date | |
| * @param {TimeType} Time type will add | |
| * @param {Date} How many adds times to value | |
| * @param {boolean | undefined} if it is true, time will add as negative way. | |
| * @returns {Date} New value | |
| */ | |
| function addTimeToDate(timeType, times, date, negative = false) { | |
| const newDate = new Date(date) |
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
| (async function (opt) { | |
| const buttons = new Array(document.querySelector(opt.postiveButtonSelector), | |
| document.querySelector(opt.negativeButtonSelector)); | |
| const repetitionInterval = opt.repetitionInterval; | |
| const sleep = async (millisecond) => new Promise((resolve) => setTimeout(resolve, millisecond)); | |
| const randomNumber = (min, max) => Math.random() * (max - min) + min; | |
| while (true) | |
| for (const btn of buttons) { |