Skip to content

Instantly share code, notes, and snippets.

View tudormunteanu's full-sized avatar
👨‍💻
Crafting and leading. Mostly Web3 these days. 🛠️🚀 #TechLeader

Tudor Munteanu tudormunteanu

👨‍💻
Crafting and leading. Mostly Web3 these days. 🛠️🚀 #TechLeader
View GitHub Profile
class SpainComparisonQuery(StrictSchema):
tariff_code = fields.Str(
description=(
"Only in Spain. Three digit version of the "
"tariff type. Example: 001 or 004."
)
)
meter_type = fields.Str(
description=(
"Only in Spain. Represents the meter type "
@tudormunteanu
tudormunteanu / requirements.txt
Created August 7, 2020 12:15
Graphene Enums vs Python Enums
_________________________________________________________________________________ test_enum _________________________________________________________________________________
def test_enum():
client = Client(schema)
executed = client.execute(
"""
{
episode
}
"""
@tudormunteanu
tudormunteanu / prepare-commit-msg
Last active February 17, 2024 16:15
git pre-commit hook to automatically prefix the commit message with the branch name
#!/bin/sh
#
# Automatically adds branch name and branch description to every commit message.
#
# Works for branch names like: XXXX-1111-longer-description
# For other patterns, please alter the regex in sed
#
PREFIX=$(git branch | grep '*' | sed 's/\(\*\ \)\([A-Z0-9\-]*\)-\([a-z\-]*\)/\2/')
@tudormunteanu
tudormunteanu / .bash_profile
Last active April 4, 2019 11:21
Example of .bash_profile config
[[ -f ~/.bashrc ]] && source ~/.bashrc
alias docker_stop_all='docker stop $(docker ps -a -q) ; docker rm $(docker ps -a -q) --force'
alias docker_rm_all='docker_stop_all ; docker rmi --force $(docker images -q -a) ; docker volume rm $(docker volume ls -qf dangling=true) ; docker network rm $(docker network ls -q)'
if [ -f /usr/local/share/bash-completion/bash_completion ]; then
. /usr/local/share/bash-completion/bash_completion
fi
export CLICOLOR=1
@tudormunteanu
tudormunteanu / router.py
Created November 9, 2018 11:44
Sanic Header Based Versioning Router
import re
import uuid
from collections import defaultdict, namedtuple
from collections.abc import Iterable
from functools import lru_cache
from urllib.parse import unquote
from sanic.constants import HTTP_METHODS
from sanic.exceptions import InvalidUsage
from sanic.exceptions import MethodNotSupported, NotFound
Daniel, thanks for the chat and offer we had the other day.
I understand that the levels were created as guidelines for the company,
but they are just that: guidelines. Not set in stone.
Given what I was told when I joined GC, rounding up your offer by 1200 would
be a sign of trust. In the bigger picture, 1200 per year is not a big sum,
but it is a matter of principle of choosing a happy, well motivated employee
over some made-up guidelines.
#!/bin/bash
# Get bash in a running container
docker exec -it 71a519182d33 bash
# docker commit example
https://gist.github.com/glamp/74188691c91d52770807
@tudormunteanu
tudormunteanu / home-brew-mysql-essential-commands
Last active May 4, 2018 16:04 — forked from jasperf/home-brew-mysql-essential-commands
Homebrew Create a MySQL database and user to be used for a WordPress site from the command line with mysql and restart server when you have a socket error or other error #wordpress #mysql #homebrew
brew services start mysql