Skip to content

Instantly share code, notes, and snippets.

View marcelopalin's full-sized avatar

Marcelo Facio Palin marcelopalin

View GitHub Profile
@balki
balki / example.py
Last active July 14, 2025 07:41
httpx tqdm example
"""
Run as below:
❯ pip install pex
❯ pex httpx tqdm -- ./example.py
"""
import asyncio, tqdm, httpx
async def get_chunks_with_progress(response: httpx.Response):
total = int(response.headers["Content-Length"])
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active May 4, 2026 07:33
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@yhatt
yhatt / marp.md
Last active April 11, 2026 15:58
Marp Next example
marp false

Marp

h:250

Markdown presentation ecosystem
@mainvoid007
mainvoid007 / installcdo.sh
Last active November 4, 2021 15:37
install cdo with grib2, hdf5, netcdf4
#!/bin/bash
# Institut für Wetter- und Klimakommunikation GmbH / Qmet
# O. Maywald <maywald@klimagipfel.de>
# This should install CDO with grib2, netcdf and HDF5 support. Note that the binaries are in /opt/cdo-install/bin.
# For further information look:
# http://www.studytrails.com/blog/install-climate-data-operator-cdo-with-netcdf-grib2-and-hdf5-support/
# docker-command
@davidalves1
davidalves1 / formatar_cnpj_cpf.md
Last active March 27, 2026 12:04
Função para formatar CNPJ e CPF, disponível em PHP e JS

PHP

function formatCnpjCpf($value)
{
  $CPF_LENGTH = 11;
  $cnpj_cpf = preg_replace("/\D/", '', $value);
  
  if (strlen($cnpj_cpf) === $CPF_LENGTH) {
    return preg_replace("/(\d{3})(\d{3})(\d{3})(\d{2})/", "\$1.\$2.\$3-\$4", $cnpj_cpf);
  } 
@alanhamlett
alanhamlett / api.py
Last active October 21, 2024 14:30
Serialize SQLAlchemy Model to dictionary (for JSON output) and update Model from dictionary attributes.
import uuid
import wtforms_json
from sqlalchemy import not_
from sqlalchemy.dialects.postgresql import UUID
from wtforms import Form
from wtforms.fields import FormField, FieldList
from wtforms.validators import Length
from flask import current_app as app
from flask import request, json, jsonify, abort