Skip to content

Instantly share code, notes, and snippets.

View raninho's full-sized avatar
🤖
Simulating what is human.

Raniere Medeiros raninho

🤖
Simulating what is human.
View GitHub Profile
@raninho
raninho / download_s3.py
Created September 24, 2020 00:28
boto3 and s3
import boto3
import json
from urllib.parse import urlparse
BUCKET_NAME = 'bucket-name'
session = boto3.Session(
aws_access_key_id="secret-id",
aws_secret_access_key="secret-access-key"
)
@raninho
raninho / Environment
Created May 18, 2022 22:21
Class to create env var in Java
import com.google.common.annotations.VisibleForTesting;
import java.lang.reflect.Field;
import java.util.Map;
@VisibleForTesting
public class Environment {
public static void set(String key, String value) {
try {
Map<String, String> env = System.getenv();
from datetime import datetime, timedelta
import random
# Parâmetros default
max_attempt = 5
backoff_seconds = 18000
backoff_factor = 2
jitter_min_seconds = 0
jitter_max_seconds = 300
last_attempt_time_str = "25/01/2024 12:00:00"