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 type { Page, Response } from "playwright"; | |
import fs from 'fs'; | |
export class PWCache { | |
private readonly cacheDir = './.cache'; | |
statistics: { | |
totalRequests: number; | |
totalCached: number; | |
totalNotCached: 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
from sync_await import sync_await | |
class BookModel(BaseModel): | |
id: int | |
title: str | |
content: str | |
async def fetch_book(id: int) -> BookModel: | |
... | |
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 json | |
import re | |
class URLPatternMatcher: | |
def __init__(self, pattern: str): | |
self.pattern = pattern.rstrip('/') | |
def match(self, path: str) -> dict | bool: | |
"""Match URL pattern |
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
from typing import List, Callable | |
class QueueTask: | |
task: Callable | |
_args: tuple = tuple() | |
_kwargs: dict = dict() | |
def __init__(self, task: Callable): | |
self.task = task |
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
# If has not commited changes - stopr script | |
if [ -n "$(git status --porcelain)" ]; then | |
echo "Please commit your changes before deploying" | |
exit 1 | |
fi | |
# If has no node_modules - install it | |
if [ ! -d "node_modules" ]; then | |
bun install | |
fi |
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
<?php | |
namespace App\Filament\Resources\Components; | |
use Filament\Forms\Components; | |
use Filament\Forms\Components\Grid; | |
use Filament\Forms\Components\Group; | |
use Filament\Forms\Components\TextInput; | |
use Filament\Forms\Set; | |
use Illuminate\Support\Str; | |
use LiveWire\Component as Livewire; |