Skip to content

Instantly share code, notes, and snippets.

View mbnmoeini's full-sized avatar

Mobina Moeini mbnmoeini

View GitHub Profile
@mbnmoeini
mbnmoeini / pythondata.md
Created April 29, 2025 11:08 — forked from ziritrion/pythondata.md
Python and libraries cheat sheet

Python

Lists

  • [1, 2, 3, 4, 5]

Power operator (2^5)

  • 2 ** 5

Square root (power operator trick)

  • 9 ** 0.5
@mbnmoeini
mbnmoeini / git.md
Created April 29, 2025 11:08 — forked from ziritrion/git.md
git cheatsheet

Basic git

  1. Clone a repo!
    • git clone user@somedomain.com/path/to/repo.git > for SSH checkout (recommended for extended use)
    • git clone https://somedomain.com/path/to/repo.git > for HTTPS checkout (easier for experimenting)
    • If you are cloning from GitHub, you can also use the GitHub CLI
      • gh repo clone path/to/repo
    • Check this section for more info on SSH vs HTTPS
  2. Make sure your local copy of the selected branch is updated.
    1. Without overwriting anything, but update the status on all branches.
@mbnmoeini
mbnmoeini / pythonenvs.md
Created April 29, 2025 11:08 — forked from ziritrion/pythonenvs.md
Python package managers and environments

uv

Experimental but very promising pip replacement that handles package managing as well as virtual environments and Python version management.

uv comes included with uvx, an alias for uv tool run. uvx allos you to install and execute command-line tools on an ephemeral environment.

Python versions

Note that you don't have to actively install a Python version! uv will automatically fetch the required Python version for your project.

@mbnmoeini
mbnmoeini / vm_containers.md
Created April 29, 2025 11:07 — forked from ziritrion/vm_containers.md
Docker, containers and VMs

Docker

Terminology

  • Container: environment that runs an applications that is not dependent on the OS. Kind of like a lightweight VM. Containers are stateless; if you need to update the components inside, create another container instead.
  • Image: template to create a container. Its components are defined by a Dockerfile.
  • Volume: storage area detached from the container for maintaining state. There are 4 types:
    • Volumes: managed by Docker itself, they're stored in a separate part of the host filesystem (on Linux by default this would be var/lib/docker/volumes). Useful for production deployments.
    • Bind mounts: mount a specific directory or file from the host to the container, such as a project folder. Useful for development.
  • Tmpfs mounts: mount a temporary file system in the container, which is stored in the host system's memory only, not on disk. Useful for sensitive information that should not be persisted between container restarts or for performance reaso