Skip to content

Instantly share code, notes, and snippets.

View Lenamaxpsi's full-sized avatar

Lena Maxutenko Lenamaxpsi

  • psifas
View GitHub Profile
@ConstantinHvber
ConstantinHvber / TailwindCSS_LLMs.txt
Created April 21, 2025 09:52
AI generated LLMs.txt for the Tailwind CSS docs (April 21, 2025)
# Tailwind CSS LLMs.txt Documentation
> This document provides a comprehensive overview of Tailwind CSS utility classes, examples, and customization options. It covers various CSS properties like layout, spacing, typography, backgrounds, borders, effects, transitions, transforms, and more, explaining how to use Tailwind's utility classes to style web elements effectively and responsively.
This document details the documentation of Tailwind CSS utilities. It explains how Tailwind scans source files for classes, the importance of using complete class names, and how utility classes can be applied conditionally using variants for states (hover, focus), responsive breakpoints, dark mode, and other conditions. It also covers customization via theme variables and adding custom styles.
**Core Concepts (from styling-with-utility-classes.mdx & responsive-design.mdx):**
* **Utility-First:** Style elements by combining many single-purpose utility classes directly in HTML.
* **Constraint-Based:** Utilities general
@Lenamaxpsi
Lenamaxpsi / pytest_fixture_mock_moto_lambda.py
Created March 25, 2024 15:41 — forked from mikegrima/pytest_fixture_mock_moto_lambda.py
pytest fixture to mock out the moto AWS Lambda capability such that it DOES NOT try to execute the code in a Docker container
import pytest
import moto
from mock import mock, patch
from moto import mock_lambda
@pytest.fixture(scope='function')
def aws_credentials():
"""Mocked AWS Credentials for moto."""
@seanchatmangpt
seanchatmangpt / gen_pydantic_instance.py
Created February 6, 2024 18:15
Create a pydantic instance from a class
import ast
import logging
import inspect
from typing import Type, TypeVar
from dspy import Assert, Module, ChainOfThought, Signature, InputField, OutputField
from pydantic import BaseModel, ValidationError
logger = logging.getLogger(__name__)
logger.setLevel(logging.ERROR)
@matteobertozzi
matteobertozzi / dataclass_from_dict.py
Last active June 2, 2024 12:27
Python dataclass from dict
from dataclasses import dataclass, is_dataclass, asdict as dataclass_as_dict, fields as dataclass_fields
def dataclass_from_dict(cls, src):
kwargs = {}
fields_lookup = {field.name: field for field in dataclass_fields(cls)}
for field_name, value in src.items():
field = fields_lookup.get(field_name)
if not field:
#logger.warning('config field %s not found for class %s', field_name, cls.__name__)
continue
@Lenamaxpsi
Lenamaxpsi / s3_multipart_upload.py
Created July 28, 2023 13:08 — forked from holyjak/s3_multipart_upload.py
boto3 S3 Multipart Upload with the ability to resume the upload after a failure
#!/usr/bin/env python3
# See https://gist.github.com/teasherm/bb73f21ed2f3b46bc1c2ca48ec2c1cf5
import argparse
import os
import boto3
class S3MultipartUpload(object):
# AWS throws EntityTooSmall error for parts smaller than 5 MB
@actapia
actapia / bs_download_projects.sh
Created July 10, 2023 04:22
Download RNA-seq data from Basespace by providing project name patterns to match
#!/usr/bin/env bash
while [ $# -gt 0 ]; do
echo "$1"
readarray -d, projinfo < <(bs project list --format csv | tail -n +2 | awk -F, -v reg="$1" '($0 ~ reg) {print $0}')
proj_dir="${projinfo[0]::-1}"
mkdir "$proj_dir"
cd "$proj_dir"
bs download project --id "${projinfo[1]::-1}"
mv ./*/*.fastq.gz .
rmdir ./*/
@motebaya
motebaya / download_progress.py
Last active August 26, 2023 03:40
async multi threading downloader with rich progress bar
#!/usr/bin/env python3
# @credit: @gist.github.com/motebaya
# @modify: 2023-08-21 10:48:13.274582300 +0700
# @gist: simple async multi threading python for download batch file
# @docs:
# https://rich.readthedocs.io/en/latest/progress.html
# https://github.com/Textualize/rich/discussions/1102
# https://testfiledownload.com/
# https://stackoverflow.com/questions/64282309/aiohttp-download-large-list-of-pdf-files
@faheemsharif-me
faheemsharif-me / kms_decryption.py
Last active August 8, 2023 13:55
KMS Decryption with Python - Decrypts Base64 Encoded Cipher Text to Plaintext
import base64
import boto3
from botocore.exceptions import ClientError
import logging
AWS_REGION = 'us-east-1'
kms_client = boto3.client("kms", region_name=AWS_REGION)
@decoupca
decoupca / thread_progress.py
Created August 10, 2022 15:44
Run a task in parallel with progress - ThreadPoolExecutor with TQDM
from typing import Callable, Iterable, Dict, List
from concurrent.futures import ThreadPoolExecutor
from tqdm import tqdm
def thread_progress(
worker: Callable,
items: Iterable,
threads: int = None,
result_handler: Callable = None,
worker_kwargs: Dict = None,
@okld
okld / components_callbacks.py
Last active January 12, 2025 14:39
Patch to use callbacks with Streamlit custom components.
"""Patch to use callbacks with Streamlit custom components.
Usage
-----
>>> import streamlit.components.v1 as components
>>> from components_callbacks import register_callback
>>>
>>> print("Script begins...")
>>>