Skip to content

Instantly share code, notes, and snippets.

View marciomazza's full-sized avatar

Marcio Mazza marciomazza

View GitHub Profile
@oinopion
oinopion / read-access.sql
Created October 5, 2016 13:00
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@muendelezaji
muendelezaji / bash-to-zsh-hist.py
Created October 5, 2016 14:18 — forked from op/bash-history-to-zsh-history.py
Convert Bash history to Zsh history
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is how I used it:
# $ cat ~/.bash_history | python bash-to-zsh-hist.py >> ~/.zsh_history
import sys
import time
@knowsuchagency
knowsuchagency / typecheck.py
Last active December 23, 2024 06:09
A cell magic to enable the use of mypy within jupyter notebooks
"""
Add mypy type-checking cell magic to jupyter/ipython.
Save this script to your ipython profile's startup directory.
IPython's directories can be found via `ipython locate [profile]` to find the current ipython directory and ipython profile directory, respectively.
For example, this file could exist on a path like this on mac:
/Users/yourusername/.ipython/profile_default/startup/typecheck.py
@rg3915
rg3915 / README.md
Last active November 29, 2023 16:26
Django padrão de nomenclatura - singular plural

Escreva quase tudo no singular, é mais fácil.

  • project: singular
  • app: singular
  • model: singular
  • field: singular
  • FK related_name: plural
  • url: plural
  • views: singular