Skip to content

Instantly share code, notes, and snippets.

View Ribeiro's full-sized avatar
💭
I may be slow to respond.

Geovanny Ribeiro Ribeiro

💭
I may be slow to respond.
  • GTech Software Services
  • Fortaleza(CE) - Brasil
  • 01:04 (UTC -03:00)
  • LinkedIn in/geovanny-ribeiro
View GitHub Profile
@Ribeiro
Ribeiro / semantic-commit-messages.md
Created February 9, 2023 21:00 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

Anti-patterns e código limpo


Conceitos

Quando se fala em desenvolvimento de software é comum ouvirmos sobre design patterns, ou padrão de projeto, que nada mais é do que uma solução geral para um problema que ocorre com frequência dentro de um determinado contexto no projeto de software. Assim, um anti-padrão é:

[...] um padrão de projeto de software que pode ser comumente usado, mas é ineficiente e/ou contra-produtivo em prática.

Anti-patterns

@Ribeiro
Ribeiro / configure.md
Created February 6, 2023 15:39 — forked from jherax/configure.md
VS Code: Debugging with Jest

VS Code: Debugging Jest

Sometimes, debugging with console.log is not enough to find out what is happening in the code, as console.log prints only plain objects but neither functions nor objects with circular references. Besides, it's possible you may need to know the context and flow of the code.

Read more about debugging with VS Code in VS Code: Debugging.

@Ribeiro
Ribeiro / README.md
Created January 25, 2023 13:31 — forked from ColCh/README.md
Git pre-push hook to confirm pushing to master
@Ribeiro
Ribeiro / SomeRepository.java
Created January 4, 2023 20:12 — forked from epiresdasilva/SomeRepository.java
Select for update skip locked with Spring Boot and Repositories
@Lock(LockModeType.PESSIMISTIC_WRITE)
@QueryHints({
@QueryHint(name = "javax.persistence.lock.timeout", value = LockOptions.SKIP_LOCKED + "") // LockOptions.SKIP_LOCKED == -2
})
List<SomeEntity> findByStatus(SomeEntityStatus status);
@Ribeiro
Ribeiro / SomeRepository.java
Created January 4, 2023 20:12 — forked from epiresdasilva/SomeRepository.java
Select for update skip locked with Spring Boot and Repositories
@Lock(LockModeType.PESSIMISTIC_WRITE)
@QueryHints({
@QueryHint(name = "javax.persistence.lock.timeout", value = LockOptions.SKIP_LOCKED + "") // LockOptions.SKIP_LOCKED == -2
})
List<SomeEntity> findByStatus(SomeEntityStatus status);
@Ribeiro
Ribeiro / download-aws-logs.sh
Created November 23, 2022 20:33 — forked from gholker/download-aws-logs.sh
Script that uses the aws cli to download cloudwatch logs to a file
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
LOG_GROUP_NAME=""
LOG_STREAM_NAME=""
REGION=""
OUTPUT_FILE="$(date +"%Y%m%d").log"
@Ribeiro
Ribeiro / GzipBodyDecompressFilter.java
Created November 20, 2022 17:42 — forked from tadhgpearson/GzipBodyDecompressFilter.java
Spring filter to decompress GZip POST body
import com.google.common.base.Stopwatch;
import com.google.common.base.Strings;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Iterables;
import com.google.common.collect.Multimap;
import com.google.common.io.ByteStreams;
import com.google.common.net.HttpHeaders;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;
@Ribeiro
Ribeiro / 1-CustomerCreatedEventSqsConsumer.java
Created October 26, 2022 17:22 — forked from rponte/1-CustomerCreatedEventSqsConsumer.java
Spring Boot: Testing a @SqsListener with TestContainers and LocalStack
package br.com.zup.edu.app2.xxx.samples.aws.sqs;
import br.com.zup.edu.app2.xxx.samples.aws.sqs.model.Customer;
import br.com.zup.edu.app2.xxx.samples.aws.sqs.model.CustomerRepository;
import io.awspring.cloud.messaging.listener.SqsMessageDeletionPolicy;
import io.awspring.cloud.messaging.listener.annotation.SqsListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.messaging.handler.annotation.Header;
@Ribeiro
Ribeiro / xmlhttp-example.asp
Created June 12, 2018 19:37
Classic ASP xmlhttp example
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><!DOCTYPE html>
<%
'----------
' This is an example of an old script I used to use to pull data from an internal web server
' and render it on a public-facing website.
'----------
Function getBBstatus()
Dim xmlhttp
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.setTimeouts 30,500,1000,1000