Skip to content

Instantly share code, notes, and snippets.

View divtxt's full-sized avatar

Div Shekhar divtxt

View GitHub Profile
@divtxt
divtxt / nvm-cheatsheet.md
Created May 6, 2024 16:39
NVM cheatsheet

Install

  • Install nvm (assumes homebrew is installed)
brew install nvm
  • Create nvm directory:

HTTPS in Development (early 2023)

Overview

Here's my steps to enable HTTPS for web/backend development.

This guide helps you generate "real" certificates! (No need to install a custom CA/certificate)

Instructions are for macOS & homebrew, but should be easy to adapt to Windows or Linux.

Poetry Cheatsheet

Your application packages will be tracked in the files pyproject.toml and poetry.lock in your project. (instead of requirements.txt)

See also: poetry docs.

Development Environment Setup

(Once per desktop)

@divtxt
divtxt / nginx-ssl-reverse-proxy.conf
Last active January 18, 2023 16:50
Nginx ssl reverse proxy config
server {
listen 443 ssl http2;
#listen [::]:443 ssl http2;
server_name app.foo.com;
ssl_certificate /etc/nginx/ssl/certificate.pem;
ssl_certificate_key /etc/nginx/ssl/key.pem;
location / {
proxy_pass http://127.0.0.1:8000/;
@divtxt
divtxt / pipenv-cheatsheet.md
Last active August 9, 2024 04:49
Pipenv Cheatsheet

Pipenv Cheatsheet

Pipenv is a single tool to manage the python version, virtualenv, and package management for a project.

  • Pipenv stores details in the Pipfile and Pipfile.lock files. (instead of requirements.txt)
  • Instructions here assume macOS with Homebrew
  • See also: pipenv docs.

Install pipenv

@divtxt
divtxt / venv-cheatsheet.md
Last active January 5, 2023 05:22
venv cheatsheet

Venv Cheatsheet

This cheatsheet provides steps to have a venv per project so each project can have different python packages installed.

This follows the convention of having the "venv" directory in the project directory.


Development Environment Setup

@divtxt
divtxt / venv-aliases.sh
Last active December 27, 2022 05:42
Aliases to create and activate python3 venv per project.
# Aliases to create and activate python3 venv per project.
#
# Copy/paste in your personal zshrc/bashrc, or include it using: source ~/.venv-aliases.sh
# Prevent pip from installing packages globally
export PIP_REQUIRE_VIRTUALENV=true
# Aliases:
alias venv-create='