Had this happen with an MAF sensor once. It had been acting up so I was already suspect of it, unplugged it and car cranked and idled smooth, that got me home (running rich as hell) swapped out with a new one and it ran perfect again.
__________________
-99' Zenith Blue 5-spd...didn't agree with a center divider on the freeway
-01' S Orient Red Metallic 6-spd...money pit...sold to buy a house