Skip to content

Instantly share code, notes, and snippets.

View ilosamart's full-sized avatar

Fábio Tramasoli ilosamart

View GitHub Profile
@johacks
johacks / VS Code Ruff - uv setup
Last active July 10, 2025 17:14
Python ruff-uv setup in VS Code
This short Gist contains a recommended configuration for using uv and ruff in a python project.
The `.vscode/settings.json` configures editor to format on save on Python files and show a ruler for configured line-length.
For it to work, the ruff VS Code extension should be installed.
The `pyproject.toml` shows a template for a Python project publishable to PyPi.
@jonlabelle
jonlabelle / ldap_search_filter_cheatsheet.md
Last active July 10, 2025 01:18
LDAP Search Filter Cheatsheet

Quem me conhece um pouco melhor sabe o quanto gosto de recomendar a leitura de livros.

Após ler um livro muito bom que me faz repensar o que sei ou apresentar algo completamente novo irei chatear as pessoas mais próximas até que elas o comprem e possam entender melhor aquela linha de pensamento ou mesmo ajudar a ajustar/melhorar algo que interpretei de uma forma diferente - basicamente forço a pessoa a entrar em um "Clube do Livro" comigo (:

Há também o caso de livros que compilam boa parte do que estudei no passado recente e me dão um feedback que estou no caminho certo - ou próximo dele.

Costumo dizer que se você está fazendo algo inédito em computação é um forte candidato ao próximo Turing Award ou idiota do ano. Minha auto-crítica sempre leva a crer na segunda opção e me obriga a constantemente a encontrar referências ou construí-las a partir de connhecimento existinte, afinal, pouquíssimas vezes na vida fui realmente pioneiro.

Livros?

@clintcarr
clintcarr / qespy.py
Last active November 7, 2024 19:24
Python QES API
import websocket
import ssl
import json
import threading
from time import sleep
ws = None
response = None
header = {'X-Qlik-User: UserDirectory=QLIKLOCAL; UserId=administrator'}
@slowkow
slowkow / pdfoptim.sh
Last active August 18, 2023 22:13
Optimize PDF files with Ghostscript.
#!/usr/bin/env bash
# pdfoptim.sh
#
# Optimize a PDF with Ghostscript
#
# Usage: bash pdfoptim.sh FILE.pdf
#
# This will copy the input file to FILE-original.pdf
# And write an optimized file to FILE.pdf
#
@gotofritz
gotofritz / gitlab-markdown-toc.js
Last active May 7, 2019 12:50
creates a gitlab markdown table of contents for a README.md page
// quick and dirty snippet to creates a gitlab markdown table of contents for a README.md page
// preview gitlab page and paste in browser console
var str = "";
$('.file-content')
.find('h1, h2, h3, h4, h5, h6, h7')
.each((i, node) => {
// node.tagName is H1 H2...
let indent = Number(node.tagName[1]) - 1;
// markdown mested lists are
// - xxx
@raprasad
raprasad / test_unmanaged_models.md
Last active November 1, 2023 00:04
Ignoring migrations during Django testing (unmanaged databases, legacy databases, etc)

Scenario

  • Django 1.9 application with two databases:
    • Legacy database with readonly access via unmanaged models. Both Django models (models.py) and related migrations have "managed" set to False
      • 'managed': False
    • Default database holding django specific tables (e.g. auth_user, django_content_type, etc)

Testing Woes

@dgmorales
dgmorales / Makefile
Last active October 9, 2024 09:53
Example Makefile for creating deb/rpm packages with jordansissel/fpm
# This is an example Makefile for quick package creation
#
# It uses FPM [1] to generate simple packages.
# - If you need more features or a greater quality package, use debian
# standard tools for packaging.
# - Do not use checkinstall. Use FPM instead.
#
# [1] (https://github.com/jordansissel/fpm/wiki)
# IMPORTANT:
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active June 15, 2025 15:49 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@ftao
ftao / install_pytho27.sh
Created July 7, 2011 10:00
install python 2.7 on debian 6
#!/bin/sh
mkdir ~/down/
cd ~/down/
sudo apt-get install build-essential
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
tar -xzf Python-2.7.2.tgz
cd Python-2.7.2
sudo apt-get install libsqlite3-dev zlib1g-dev libncurses5-dev
sudo apt-get install libgdbm-dev libbz2-dev libreadline5-dev
sudo apt-get install libssl-dev libdb-dev