How to hide a specific part of dashboard for non-admin roles?

I’m not sure what exactly you are trying to do, since the link you provided does not speak of removing any admin page (merely excluding some posts).

Anyhow, if you want to block the managers access to some page, you can redirect them to somewhere else if they try to access that page.

add_filter( 'admin_init', 'redirect_managers' );
function redirect_managers() {
    global $pagenow; // Global containing the current page
    if ( $pagenow=='edit.php' && current_user_can('manager') ) {
        // If the user has the manager role, redirect them back to dashboard
        wp_safe_redirect( admin_url() );
        // You can also remove the page from the menu
        remove_submenu_page( 'profile.php' );
    }
}

But if you meant to hide an specific part of a page, while showing the other parts (for example, hide the header but show the footer) that’s probably not possible due to hard codes admin pages. You might however be able to modify the sections one by one, for example hook into the avatar, username, etc.

TL;DR

You can’t. If a part of the admin area does not support a hook or filter, it means that it’s hardcoded in the templates. You have to either modify the core ( Not recommended at all ) or create a plugin that does the job for you, and then disable the entire area.