Skip to content

Instantly share code, notes, and snippets.

View eevmanu's full-sized avatar
🎯
focused

Manuel Solorzano eevmanu

🎯
focused
View GitHub Profile
{
"backmatter": "",
"bulletListMarker": "-",
"codeBlockStyle": "fenced",
"contextMenus": true,
"disallowedChars": "[]#^",
"downloadImages": false,
"downloadMode": "downloadsApi",
"emDelimiter": "_",
"fence": "```",
@eevmanu
eevmanu / dockerfile
Created January 10, 2023 21:31
random example of multi-stage build of a fastapi app
# --------------------------------------------------------------------------------
# temp stage
FROM python:3.10.9-slim-bullseye as builder
WORKDIR /code
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
@eevmanu
eevmanu / settings.json
Created January 4, 2023 02:38
VS Code folder settings example / template for a python project
{
// --------------------------------------------------------------------------------
// personal code editor config
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"files.exclude": {
@eevmanu
eevmanu / explanation.md
Created September 6, 2022 15:34
differences between `odd`, `likelihood`, `probablity`, `chance` I found over internet
  • odd
    • in statistics
      • 0 to ∞
  • likelihood
    • in statistics
      • attach to hypotheses
      • before
      • 0 to 1
  • probablity
  • in statistics
@eevmanu
eevmanu / main_v1.py
Last active February 9, 2023 04:08
default way to start python module as script
#!/usr/bin/env python
# MIT License
# Copyright (c) 2022-present, Manuel Solorzano
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@eevmanu
eevmanu / custom_prompt.sh
Created February 27, 2022 22:14
custom prompt I don't use anymore because I prefer [startship](https://github.com/starship/starship)
function custom_prompt {
# https://tldp.org/HOWTO/Bash-Prompt-HOWTO/bash-prompt-escape-sequences.html
# \e == \033
# Select Graphic Rendition parameters
# 30–37 selected the foreground color
# 40–47 selected the background color
# prompt
FMT_RESET="\[\e[0m\]"
@eevmanu
eevmanu / setup.md
Last active May 14, 2022 06:48
virtualenv + virtualenvwrapper setup (from almost 8 years ago)

Virtualenv + Wirtualenvwrapper

Check python binary to use

$ export VIRTUALENVWRAPPER_PYTHON=/path/to/.../python
$ export VIRTUALENVWRAPPER_PYTHON=${HOME}/bin/python

Path where virtual environments will be created

@eevmanu
eevmanu / template.py
Created February 16, 2022 20:21
Template from Matt Harrison 🧡 talking about decorators in Python 🐍 πŸ‘‰ https://twitter.com/__mharrison__/status/1491080949647380481
import functools
def decorator(func_to_decorate):
@functools.wraps(func_to_decorate)
def wrapper(*args, **kwargs):
# πŸ‘‰ BEFORE πŸ‘ˆ invocation
result = func_to_decorate(*args, **kwargs)
# πŸ‘‰ AFTER πŸ‘ˆ invocation
return result
return wrapper
@eevmanu
eevmanu / age_counting.py
Last active February 1, 2023 16:37
age counting solution in python
# import requests
# r = requests.get("coderbyte.com/api/challenges/json/age-counting")
# d = r.json()
d = {
"data": "key=IAfpK, age=58, key=WNVdi, age=64, key=jp9zt, age=47, key=0Sr4C, age=68, key=CGEqo, age=76, ... key=cFCfU, age=5, key=J8an1, age=48, key=dkSlj, age=5"
}
l = d['data'].split(", ")