Skip to content

Instantly share code, notes, and snippets.

View pvergain's full-sized avatar

Noam Vergain pvergain

View GitHub Profile
@pvergain
pvergain / slug.py
Created December 6, 2022 08:44
call slugify from the command line
"""slug.py
- https://github.com/un33k/python-slugify
Exemple d'appel
==================
::
@pvergain
pvergain / custom_django_checks.py
Created June 7, 2018 06:01 — forked from hakib/custom_django_checks.py
Custom django checks using Django check framework, inspect and ast.
"""
Custom django checks.
H001: Field has no verbose name.
H002: Verbose name should use gettext.
H003: Words in verbose name must be all upper case or all lower case.
H004: Help text should use gettext.
H005: Model must define class Meta.
H006: Model has no verbose name.
H007: Model has no verbose name plural.
set -g mouse on
@pvergain
pvergain / gitconfig.ini
Created March 14, 2018 14:20 — forked from tdd/gitconfig.ini
Nice, useful global Git configuration
# Put this in your ~/.gitconfig or ~/.config/git/config
# Windows users: "~" is your profile's home directory, e.g. C:\Users\<YourName>
[user]
name = Your Full Name
email = your@email.tld
[color]
# Enable colors in color-supporting terminals
ui = auto
[alias]
st = status
@pvergain
pvergain / git tutorials.md
Created March 10, 2018 22:18 — forked from jaseemabid/git tutorials.md
Awesome git tutorials I am finding here and there
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Exemple d'application Python basée sur pyserial, logging et click."""
# Import standard modules
from os.path import abspath, basename, dirname, join, normpath
import binascii
import csv
import string
# https://store.docker.com/images/postgres
FROM postgres:10.2
# avec cette image on peut mettre en place la locale fr_FR.utf8
RUN localedef -i fr_FR -c -f UTF-8 -A /usr/share/locale/locale.alias fr_FR.UTF-8
ENV LANG fr_FR.utf8
version: '3.1'
services:
db:
build:
context: .
dockerfile: Dockerfile
restart: always
volumes:
@pvergain
pvergain / Dockerfile.centos7.python36.pipenv
Last active November 18, 2020 23:31
Dockerfile based on centos:7 Python3.6 and pipenv
# Use an official centos7 image
FROM centos:7
RUN localedef -i fr_FR -c -f UTF-8 -A /usr/share/locale/locale.alias fr_FR.UTF-8
ENV LANG fr_FR.utf8
# gcc because we need regex and pyldap
# openldap-devel because we need pyldap
RUN yum update -y \
&& yum install -y https://centos7.iuscommunity.org/ius-release.rpm \
@pvergain
pvergain / setup.py
Created January 18, 2018 08:22
A setup.py example from the cronicle project (https://github.com/KraYmer/cronicle)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Fabrice Laporte - kray.me
# The MIT License http://www.opensource.org/licenses/mit-license.php
from setuptools import setup
def coerce_file(fn):