Skip to content

Instantly share code, notes, and snippets.

@moskrc
moskrc / list_urls.py
Created March 2, 2023 14:46
List all Django urls
from django.conf import settings
from django.core.management import BaseCommand
from django.urls import URLPattern, URLResolver
urlconf = __import__(settings.ROOT_URLCONF, {}, {}, [''])
def list_urls(lis, acc=None):
if acc is None:
acc = []
if not lis:
@CMCDragonkai
CMCDragonkai / bash_interactive_and_login.sh
Last active August 5, 2023 09:54
Bash & ZSH: Interactive and Login Shells
#!/usr/bin/env bash
[[ $- == *i* ]] && echo "This Bash Shell is Interactive Shell" || echo "This Bash Shell is Not a Interactive Shell"
shopt -q login_shell && echo "This Bash Shell is a Login Shell" || echo "This Bash Shell is Not a Login Shell"
@jezdez
jezdez / .profile
Created September 13, 2014 11:43
My pyenv setup
export PYENV_VIRTUALENVWRAPPER_PREFER_PYVENV="true"
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
pyenv virtualenvwrapper