Skip to content

Instantly share code, notes, and snippets.

View AndersonCRocha's full-sized avatar
🏠
Working from home

Anderson Rocha AndersonCRocha

🏠
Working from home
View GitHub Profile
@AndersonCRocha
AndersonCRocha / aside-menu.component.html
Last active September 4, 2025 19:34
Menu lateral expasível feito em angular + tailwind
<aside
[ngClass]="[
'flex flex-col bg-azul-padrao text-white py-5 transition-all relative border-r border-azul-primario',
menuAberto ? 'w-64 min-w-64' : 'w-20 min-w-20',
]"
>
<button
class="absolute top-0 right-0 translate-x-[100%] rounded-r-lg px-2 py-1 grid place-items-center bg-azul-padrao cursor-pointer hover:bg-azul-primario transition-colors border border-azul-primario"
(click)="toggleMenu()"
>
@AndersonCRocha
AndersonCRocha / base-service.ts
Created September 3, 2025 13:56
Arquivo base de service usado em aplicações WEB e comunicação com endpoints REST usando o axios
import axios from "axios";
import { env } from "@/config/env";
import { hasData } from "@/utils/functions";
export const httpClient = axios.create({
baseURL: env.apiBaseUrl,
paramsSerializer: (params) =>
Object.entries(params)
.filter(([, value]) => hasData(value))
@AndersonCRocha
AndersonCRocha / JpaSqlFunctionBuilder.java
Created October 24, 2024 00:16
Builder utilitário para criação de funções customizadas JPQL
import org.hibernate.dialect.function.StandardSQLFunction;
import org.hibernate.query.ReturnableType;
import org.hibernate.sql.ast.SqlAstTranslator;
import org.hibernate.sql.ast.spi.SqlAppender;
import org.hibernate.sql.ast.tree.SqlAstNode;
import org.hibernate.type.BasicTypeReference;
import org.hibernate.type.SqlTypes;
import java.util.ArrayList;
import lombok.experimental.UtilityClass;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.util.Objects;
@UtilityClass
public class GeolocationUtils {
import jakarta.persistence.Tuple;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Function;
@AndersonCRocha
AndersonCRocha / readme.md
Created November 4, 2021 01:01
Mapa do Brasil interativo com React e Typescript
@AndersonCRocha
AndersonCRocha / README.md
Last active June 29, 2021 23:40
Efeito de carregamento com React + Typescript + Styled-components