Skip to content

Instantly share code, notes, and snippets.

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

Marcelo Mariano marcelohmariano

🏠
Working from home
  • Brazil
View GitHub Profile
@marcelohmariano
marcelohmariano / quick_sort.py
Created February 27, 2023 01:33
Quick Sort in Python
def partition(array, low, high):
pi = low
pivot = array[high]
for i in range(low, high):
if array[i] <= pivot:
array[pi], array[i] = array[i], array[pi]
pi += 1
array[pi], array[high] = array[high], array[pi]
@marcelohmariano
marcelohmariano / python_requests_retry.py
Last active September 24, 2022 10:41
Python requests + retry
from typing import Dict, Any, Optional, Union
import requests.adapters
import uvicorn
from fastapi import FastAPI
from fastapi.responses import JSONResponse
app = FastAPI()
public_ip_apis = [
@marcelohmariano
marcelohmariano / docker-compose.yml
Created April 17, 2022 18:46
Local Kafka setup using Docker Compose
version: "3"
services:
zookeeper:
image: bitnami/zookeeper
ports:
- "2181:2181"
environment:
ALLOW_ANONYMOUS_LOGIN: yes
volumes:
@marcelohmariano
marcelohmariano / Makefile
Last active January 19, 2022 19:35
Use go mod to manage go tools
SHELL := /bin/sh
BIN := bin
define ADD_TOOL_BINARY_RULE
TOOLS_BINARIES += $$(BIN)/$$(notdir $(1))
$$(lastword $$(TOOLS_BINARIES)):
@go build -o $$@ $(1)
endef
@marcelohmariano
marcelohmariano / pro4trello-custom-css.css
Last active January 11, 2022 14:54
Pro for Trello custom CSS
@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&display=swap');
#board {
font-family: 'Comic Neue', cursive;
font-weight: 700;
}
.list-card-title {
font-weight: 300;
}
@marcelohmariano
marcelohmariano / viper-and-cobra-example.go
Last active April 18, 2021 16:27
Viper and Cobra example
package main
import (
"fmt"
"log"
"net/http"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
@marcelohmariano
marcelohmariano / README-Template.md
Last active July 15, 2019 22:26 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@marcelohmariano
marcelohmariano / clang-format-google-based-cpp-style.sh
Last active July 2, 2021 16:58
Google based C++ style to use with ClangFormat
#!/bin/bash
clang-format -style="{\
BasedOnStyle: Google, \
AccessModifierOffset: -2, \
AlignEscapedNewlines: DontAlign, \
AlignTrailingComments: false, \
AllowShortFunctionsOnASingleLine: Inline, \
AllowShortIfStatementsOnASingleLine: false, \
AllowShortLoopsOnASingleLine: false, \

Docker Container Name

A one paragraph description about the container.

Getting Started

These instructions will cover usage information for the Docker container.

Prerequisities