Skip to content

Instantly share code, notes, and snippets.

View os-ia's full-sized avatar
:shipit:

Iago Alonso os-ia

:shipit:
View GitHub Profile
@os-ia
os-ia / odoo_installation_flags.sh
Last active November 22, 2021 08:54
Fixes for the Odoo installation from source on macOS
# General
xcode-select --install
# 2to3 error; python_version < "3.8"
pip install setuptools <=57.5.0
# Pillow
brew install libjpeg
brew install zlib
export LDFLAGS="-L/usr/local/opt/zlib/lib"
@os-ia
os-ia / .pre-commit-config.yaml
Last active June 17, 2022 07:49
Example pre-commit config for Python projects
repos:
- repo: meta
hooks:
- id: check-useless-excludes
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-added-large-files
- id: check-ast
@os-ia
os-ia / pyproject.toml
Last active June 17, 2022 07:49
Example configuration files for Python packages
[build-system]
requires = [
"setuptools",
"wheel",
]
build-backend = "setuptools.build_meta"
[tool.black]
line-length = 120
skip-string-normalization = true
@os-ia
os-ia / get_table_constraints.sql
Created January 20, 2022 13:56
Get all constraints of a PostgreSQL table
SELECT con.*
FROM pg_catalog.pg_constraint con
INNER JOIN pg_catalog.pg_class rel
ON rel.oid = con.conrelid
INNER JOIN pg_catalog.pg_namespace nsp
ON nsp.oid = connamespace
WHERE nsp.nspname = '<schema name>'
AND rel.relname = '<table name>';
@os-ia
os-ia / get_pkg_details.sh
Created April 12, 2022 07:25
Get PKG details like identifier, version, install-location...
#!/usr/bin/env bash
pkgutil --expand $1 /tmp/pkg; cat /tmp/pkg/PackageInfo | grep "version=" ; rm -rf /tmp/pkg