Skip to content

Instantly share code, notes, and snippets.

View feluelle's full-sized avatar

Felix Uellendall feluelle

View GitHub Profile
@feluelle
feluelle / naming_convention_transformer.py
Created September 1, 2020 16:25
A small script for transforming text to various widely used naming conventions like snake_case or camelCase.
def transform_string(string: str, separator: str, upper: bool) -> str:
def _words() -> list:
return string.split()
def _first_character(word: str) -> str:
return word[0].upper() if upper else word[0].lower()
return separator.join(_first_character(word[0]) + word[1:] for word in _words())
@feluelle
feluelle / docker-compose.yaml
Last active March 16, 2021 22:05
My Apache Airflow docker-compose file for running LocalExecutor with postgres using official production Dockerfile
x-airflow-environment: &airflow-environment
environment:
- HOST_HOME=${HOME}
- HOST_PROJECT_PATH=${PWD}
env_file: airflow.env
image: feluelle/airflow:latest
x-airflow-volumes: &airflow-volumes
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ~/.aws:/home/airflow/.aws
@feluelle
feluelle / google_api_integration_in_airflow.py
Last active August 14, 2024 19:58
Google API (and S3) integration in Airflow
#
# -------------------- authorize script --------------------
#
# -*- coding: utf-8 -*-
"""
Just adjust the global variables accordingly and then run this script from the command line.
Make sure the correct client_secret_file is selected,
and that it has the necessary right configured.
@feluelle
feluelle / color.py
Created April 22, 2019 19:42
Enumeration of Colors that are also colored when printed
from enum import Enum
class Color(Enum):
RED = '\033[31m'
GREEN = '\033[32m'
YELLOW = '\033[33m'
BLUE = '\033[34m'
def __repr__(self):
return f'{self.value}{self.name}\033[0m'