Big tech companies had big layoffs. Then they saw big profits