Skip to content

Instantly share code, notes, and snippets.

View oeeckhoutte's full-sized avatar

Olivier Eeckhoutte oeeckhoutte

View GitHub Profile
@oeeckhoutte
oeeckhoutte / mypy.ini
Created December 30, 2022 10:21
mypy.ini
[mypy]
ignore_missing_imports = True
allow_redefinition = True
disallow_untyped_defs = True
disallow_incomplete_defs = True
disallow_untyped_calls = True
no_strict_optional = False
no_warn_no_return = True
@oeeckhoutte
oeeckhoutte / pyproject.toml
Created June 24, 2022 10:51
black config
[tool.black]
line-length = 79
@oeeckhoutte
oeeckhoutte / sitecustomize.py
Created June 24, 2022 09:40
Basic and base sitecustomize file I am using in all my Python projects for fast development when communicating with external services
import os
CRED = '\033[91m'
CEND = '\033[0m'
def print_red(msg):
print(CRED + "#"*80 + CEND)
print(CRED + msg + CEND)
print(CRED + "#"*80 + CEND)
@oeeckhoutte
oeeckhoutte / .gitignore
Last active January 2, 2023 14:49
Simple .gitignore I am using for my Python projects
# https://raw.githubusercontent.com/github/gitignore/master/Python.gitignore
.ipynb_checkpoints
.envrc
.dvc
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
@oeeckhoutte
oeeckhoutte / gist:718b2c19df9929e70e50510bfec0d286
Created August 10, 2021 13:02
[FASTER DEV] External API calls cache (long process) for local dev only (requests python)
#### TODO #####################################################################
import requests_cache
requests_cache.install_cache("dev_cache")
# For dev only
# If you see this in a PR raise an alert
###############################################################################
@oeeckhoutte
oeeckhoutte / settings.json
Last active December 30, 2022 10:24
VScode basic config for Python virtualenv with flake8 and black (.vscode/ dir)
{
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.formatting.provider": "black",
"editor.rulers": [
79
],
"python.linting.pylintEnabled": false,
"python.linting.mypyEnabled": true,
"editor.codeLens": true,
  • Change Default response timeout for a specific route:
oc annotate route <route_name> --overwrite haproxy.router.openshift.io/timeout=10s
  • Add a nodeSelector on RC ou DC
oc patch dc|rc <dc_name> -p "spec:                                                                                         
  template:     
@oeeckhoutte
oeeckhoutte / OpenshiftOrigin.md
Created May 1, 2018 21:10 — forked from kuchibs/OpenshiftOrigin.md
Use Ansible to install Openshift Origin (oc) single node cluster on number of machines!

Install OpenShift Origin on one node (CENTOS) - commands:

1) Install docker

yum install docker -y 
systemctl start docker

Note:

echo "INSECURE_REGISTRY='--insecure-registry 172.30.0.0/16'" >> /etc/sysconfig/docker
systemctl enable docker
@oeeckhoutte
oeeckhoutte / install_minikube.sh
Last active January 12, 2018 13:15
Install Helm and Minikube on Ubuntu 16.04 on Azure
# Install virtualbox
sudo apt-get install virtualbox
# Install kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin
# Install minikube
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
# Launch Minikube
@oeeckhoutte
oeeckhoutte / flash-app.js
Created December 19, 2017 10:11 — forked from brianmacarthur/flash-app.js
Flash messaging in Express 4: express-flash vs. custom middleware in ejs, handlebars, or jade
var express = require('express');
var cookieParser = require('cookie-parser');
var session = require('express-session');
var flash = require('express-flash');
var handlebars = require('express-handlebars')
var app = express();
var sessionStore = new session.MemoryStore;
// View Engines