Skip to content

Instantly share code, notes, and snippets.

View lorey's full-sized avatar
shipping

Karl Lorey lorey

shipping
View GitHub Profile
@kissgyorgy
kissgyorgy / sqlalchemy_conftest.py
Last active March 5, 2024 23:05
Python: py.test fixture for SQLAlchemy test in a transaction, create tables only once!
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
from myapp.models import BaseModel
import pytest
@pytest.fixture(scope="session")
def engine():
return create_engine("postgresql://localhost/test_database")
@vasanthk
vasanthk / System Design.md
Last active March 26, 2024 07:53
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@tomasfejfar
tomasfejfar / docker-compose.yml
Created April 3, 2018 11:35
Using YAML to reuse parts of existing docker-compose configuration
version: "3"
services:
apache: &apacheConfig
build: .
volumes:
- ./:/var/www/html:cached
- ./docker/php-apache/php.ini:/usr/local/etc/php/php.ini
- ./docker/php-apache/ssl-local:/etc/httpd/ssl
working_dir: /var/www/html
ports:
Rank Type Prefix/Suffix Length
1 Prefix my+ 2
2 Suffix +online 6
3 Prefix the+ 3
4 Suffix +web 3
5 Suffix +media 5
6 Prefix web+ 3
7 Suffix +world 5
8 Suffix +net 3
9 Prefix go+ 2