Find all files under ~/code that are executable by owner without descending into hidden directories and print their parent directories appended with : at the beginning and remove all newlines and the last : (colon)
find ~/code -name '.*' -prune -o -type f -a -perm /u+x -print | sed 's@/[^/]\+$@:@' | sort | uniq | tr -d '\n' | sed 's/^/:/; s/:$//'