Skip to content

Instantly share code, notes, and snippets.

@remlapmot
remlapmot / empty-gh-pages-branch.sh
Created June 28, 2022 11:51
Create empty gh-pages branch and push to GitHub
#!/bin/bash
# From https://blog.ediri.io/how-to-create-a-github-gh-pages-branch-in-an-existing-repository
git checkout --orphan gh-pages
git reset --hard
git commit --allow-empty -m "Empty gh-pages branch"
git push origin gh-pages
@techtonik
techtonik / caller_name.py
Created March 21, 2012 19:29
Python - inspect - Get full caller name (package.module.function)
# Public Domain, i.e. feel free to copy/paste
# Considered a hack in Python 2
import inspect
def caller_name(skip=2):
"""Get a name of a caller in the format module.class.method
`skip` specifies how many levels of stack to skip while getting caller
name. skip=1 means "who calls me", skip=2 "who calls my caller" etc.