Skip to content

Instantly share code, notes, and snippets.

View Cosikowy's full-sized avatar
🎯
Focusing

Aleks J Cosikowy

🎯
Focusing
  • Lublin, Poland
View GitHub Profile
@Cosikowy
Cosikowy / docker-compose.yml
Created February 27, 2023 00:11
Docker-compose + django - wait for db to be up then start django server
services:
app:
build:
dockerfile: dockerfile
context: .
ports:
- 8000:8000
entrypoint: python manage.py runserver 0.0.0.0:8000
env_file: .env
volumes:

Python / Django conventions found at https://github.com/octoenergy/conventions/blob/master/python.md

Python

These are a series of conventions (to follow) and anti-patterns (to avoid) for writing Python and Django application code. They are intended to be an aid to code-review in that common comments can reference a single detailed explanation.

Django:

@Cosikowy
Cosikowy / multiple_ssh_setting.md
Created July 20, 2022 22:11 — forked from aleksanderjagiello/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@Cosikowy
Cosikowy / gist:0d2d138da495e909cec87b7993a08a5b
Created April 6, 2022 08:59 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
# place this in __init__.py to import all modules from directory to globals
import pkgutil
__all__ = []
for loader, module_name, is_pkg in pkgutil.walk_packages(__path__):
__all__.append(module_name)
_module = loader.find_module(module_name).load_module(module_name)
globals()[module_name] = _module
@Cosikowy
Cosikowy / colors.py
Created September 13, 2021 06:26 — forked from rene-d/colors.py
ANSI color codes in Python
# SGR color constants
# rene-d 2018
class Colors:
""" ANSI color codes """
BLACK = "\033[0;30m"
RED = "\033[0;31m"
GREEN = "\033[0;32m"
BROWN = "\033[0;33m"
BLUE = "\033[0;34m"
def nats(s):
yield s
yield from nats(s+1)
def sieve(s):
n = next(s)
yield n
yield from sieve(i for i in s if i%n!=0)