This guide outlines best practices for building a Vite / React / Tailwind / Nanostores / Astro application. The goal is readability and maintainability, minimizing abstraction to keep the codebase clear.
- Astro
- Preact
- Nanostores
- Tailwind CSS
- Postgres
This guide outlines best practices for building a Vite / React / Tailwind / Nanostores / Astro application. The goal is readability and maintainability, minimizing abstraction to keep the codebase clear.
| { | |
| "inputs": [ | |
| { | |
| "type": "promptString", | |
| "id": "github-pat", | |
| "password": true, | |
| "description": "GitHub Personal Access Token (PAT, https://github.com/settings/personal-access-tokens/new)" | |
| } | |
| ], | |
| "servers": { |
| #!/usr/bin/env -S node --no-warnings=ExperimentalWarning --enable-source-maps | |
| // Claude Code is a Beta product per Anthropic's Commercial Terms of Service. | |
| // By using Claude Code, you agree that all code acceptance or rejection decisions you make, | |
| // and the associated conversations in context, constitute Feedback under Anthropic's Commercial Terms, | |
| // and may be used to improve Anthropic's products, including training models. | |
| // You are responsible for reviewing any code suggestions before use. | |
| // (c) Anthropic PBC. All rights reserved. Use is subject to Anthropic's Commercial Terms of Service (https://www.anthropic.com/legal/commercial-terms). |
| { | |
| // Enable autocompletion for Python | |
| "python.analysis.extraPaths": ["${workspaceFolder}/external/+vs_code_python_autocompletion+py_deps"], | |
| } |
| import os | |
| import openai | |
| import requests | |
| from pprint import pprint | |
| import dotenv | |
| dotenv.load_dotenv() | |
| openai_api_key = os.environ.get("OPENAI_API_KEY") | |
| bing_search_api_key = os.environ['BING_SEARCH_V7_SUBSCRIPTION_KEY'] |
| package main | |
| import ( | |
| "bufio" | |
| "bytes" | |
| "context" | |
| "encoding/json" | |
| "errors" | |
| "fmt" | |
| "net/http" |
| library(rb3) | |
| library(tidyverse) | |
| top_weight <- function(.data, n = 10) { | |
| top_10 <- .data |> | |
| arrange(desc(weight)) |> | |
| slice_head(n = n) |> | |
| select(symbol, weight) | |
| total_weight <- sum(top_10$weight) | |
| others <- tibble( |
| @Configuration | |
| public class BeanValidationConfig { | |
| /** | |
| * The idea here is to configure Hibernate to use the same ValidatorFactory used by Spring, | |
| * so that Hibernate will be able to handle custom validations that need to use dependency injection (DI) | |
| */ | |
| @Bean | |
| public HibernatePropertiesCustomizer hibernatePropertiesCustomizer(final Validator validator) { | |
| return new HibernatePropertiesCustomizer() { |
| /** | |
| * Metannotation for OnConfigurationPropertiesCondition custom conditional implementation. | |
| */ | |
| @Target({ElementType.TYPE, ElementType.METHOD}) | |
| @Retention(RetentionPolicy.RUNTIME) | |
| @Documented | |
| @Conditional(OnConfigurationPropertiesCondition.class) | |
| public @interface ConditionalOnConfigurationProperties { | |
| // properties namespace |
| /* | |
| * Available context bindings: | |
| * COLUMNS List<DataColumn> | |
| * ROWS Iterable<DataRow> | |
| * OUT { append() } | |
| * FORMATTER { format(row, col); formatValue(Object, col); getTypeName(Object, col); isStringLiteral(Object, col); } | |
| * TRANSPOSED Boolean | |
| * plus ALL_COLUMNS, TABLE, DIALECT | |
| * | |
| * where: |