The president fired off a series of posts well after midnight that included private messages from world leaders.