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 parseSeparated(text: string, delimiter: string = ','): string[][] { | |
| const rows: string[][] = []; | |
| let field = ''; | |
| let row: string[] = []; | |
| let inQuotes = false; | |
| for (let i = 0; i < text.length; i++) { | |
| const char = text[i]; | |
| const next = text[i + 1]; |
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 { useEffect, useState } from 'react'; | |
| export type BlobType = File | Blob | MediaSource | null; | |
| export function useObjectUrl(initialObject: BlobType | (() => BlobType) = null) { | |
| const [objectUrl, setObjectUrl] = useState<string | null>(null); | |
| const [object, setObject] = useState<BlobType>(initialObject); | |
| useEffect(() => { |
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
| <?php | |
| namespace App\Jobs; | |
| use Illuminate\Bus\Queueable; | |
| use Illuminate\Contracts\Queue\ShouldQueue; | |
| use Illuminate\Queue\InteractsWithQueue; | |
| use Illuminate\Queue\SerializesModels; | |
| class BackgroundPollingJob implements ShouldQueue |
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
| type TapProxy<T extends object> = { | |
| [K in keyof T]: T[K] extends (...args: infer A) => unknown | |
| ? (...args: A) => T | |
| : T[K]; | |
| }; | |
| function tap<T extends object>(obj: T): TapProxy<T>; | |
| function tap<T extends object>(obj: T, fn: (target: T) => void): T; | |
| function tap<T extends object>( | |
| obj: T, |
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
| # Stage 1: Build | |
| FROM php:8.4-cli AS build | |
| # Setup build root | |
| WORKDIR /app | |
| # Install dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| git \ | |
| unzip \ |
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 { cn } from '@/lib/utils'; | |
| import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area'; | |
| import * as React from 'react'; | |
| import { useEffect, useRef, useState } from 'react'; | |
| const ScrollArea = React.forwardRef< | |
| React.ComponentRef<typeof ScrollAreaPrimitive.Root>, | |
| React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> & { fade?: boolean } | |
| >(({ className, fade, children, ...props }, ref) => { | |
| const viewPortRef = useRef<HTMLDivElement | null>(null); |
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 { FormDataKeys, FormDataType, Method } from '@inertiajs/core'; | |
| // @ts-expect-error TS2307 | |
| import type { Response } from '@inertiajs/core/types/response'; | |
| import type { InertiaFormProps } from '@inertiajs/react'; | |
| import { useForm } from '@inertiajs/react'; | |
| import axios, { AxiosProgressEvent, AxiosRequestConfig, AxiosResponse } from 'axios'; | |
| import { cloneDeep } from 'lodash-es'; | |
| import { useCallback, useMemo, useRef, useState } from 'react'; | |
| type HttpMethod = 'get' | 'post' | 'put' | 'patch' | 'delete'; |
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
| <?php | |
| namespace App\Casts; | |
| use Brick\Money\Money; | |
| use UnexpectedValueException; | |
| use Illuminate\Database\Eloquent\Model; | |
| use Illuminate\Contracts\Database\Eloquent\CastsAttributes; | |
| use Illuminate\Contracts\Database\Eloquent\SerializesCastableAttributes; |
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 { | |
| forwardRef, | |
| MiddlewareConsumer, | |
| Module, | |
| NestModule, | |
| } from '@nestjs/common'; | |
| import { TypeOrmModule } from '@nestjs/typeorm'; | |
| import { Audit } from '@/audit/entities/audit.entity'; | |
| import { AuditMiddleware } from '@/audit/middlewares/audit.middleware'; | |
| import { APP_GUARD } from '@nestjs/core'; |
NewerOlder