Formerly homeless man and dog get new apartment