title | author | date | source | notoc |
---|---|---|---|---|
LDAP Search Filter Cheatsheet |
Jon LaBelle |
January 4, 2021 |
true |
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. |
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.
import websocket | |
import ssl | |
import json | |
import threading | |
from time import sleep | |
ws = None | |
response = None | |
header = {'X-Qlik-User: UserDirectory=QLIKLOCAL; UserId=administrator'} |
#!/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 | |
# |
// 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 |
- 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)
- Legacy database with readonly access via unmanaged models. Both Django models (models.py) and related migrations have "managed" set to
- For testing I want to re-create the legacy database tables. In other words, during
python manage.py test
, tell Django to set "managed" toTrue
- There are several excellent blog posts on how to set "managed" to
True
during tests:
- There are several excellent blog posts on how to set "managed" to
- http://blog.birdhouse.org/2015/03/25/django-unit-tests-against-unmanaged-databases/
# 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: |
This playbook has been removed as it is now very outdated. |
#!/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 |