As tarabyte alludes to, this has to deal with parameter expansion.
$0 is the name and path that this script was executed with. For example, if you call /usr/bin/example.sh, then $0 will be "/usr/bin/example.sh". If your current working directory is /usr, and you call the same script with ./bin/example.sh, then $0 will be "./bin/example.sh".
As for the "#", this means to expand $0 after removing the previously specified prefix. In this case the previously specified prefix is the */ glob. A single "#" is non-greedy, so after it matches the first */ glob, it will stop. So it will remove the first "/" and everything before it. Two "#"'s mean to greedily remove all */. So it will find remove all "/" and everything that comes before them.
Edit Summary: ${0##*/} is equivalent to $(basename $0) but without the extra forking