Skip to content

Instantly share code, notes, and snippets.

View pvergain's full-sized avatar

Noam Vergain pvergain

View GitHub Profile
@pvergain
pvergain / gist:5a7466e7397bdbf235ab6f914838544e
Last active November 20, 2017 13:05
Django multiple databases access example
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# common.db_id3web.py
#
from __future__ import unicode_literals
import django.db.models as models
@pvergain
pvergain / gist:7a27f28d1783818b1dec2886b9aade36
Last active November 20, 2017 13:04
sphinx conf.py example
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Spécifications id3 intranet documentation build configuration file, created by
# sphinx-quickstart on Mon Jul 31 08:55:06 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
@pvergain
pvergain / conf_sybase.py
Last active November 20, 2017 13:56
How to access a 10.0 SQL Anywhere database (2006) with Python 3.6
"""config.tests.conf_sybase.py
.. seealso::
- http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.sqlanywhere.12.0.1/dbprogramming/pg-python.html
"""
# https://github.com/sqlanywhere/sqlanydb
import sqlanydb
2010 1/4/2010 1 425 504 460 4 628 115 $38 495 460 645
2010 1/5/2010 1 754 011 750 5 394 016 $43 932 043 406
2010 1/6/2010 1 655 507 953 5 494 460 $43 816 749 660
2010 1/7/2010 1 797 810 789 5 674 297 $44 104 237 184
2010 1/8/2010 1 545 692 647 5 008 824 $40 816 677 580
2010 1/11/2010 1 492 666 469 4 970 320 $41 341 854 839
2010 1/12/2010 1 685 064 003 5 600 471 $45 676 531 877
2010 1/13/2010 1 468 586 700 4 989 082 $39 877 317 621
2010 1/14/2010 1 357 605 480 4 552 360 $36 899 505 722
2010 1/15/2010 1 952 486 180 5 335 459 $53 482 586 973
@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):
@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 \
version: '3.1'
services:
db:
build:
context: .
dockerfile: Dockerfile
restart: always
volumes:
# 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
#!/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
@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