if its only for 1-2 minutes ( i guess that's the time until you get switched to generator power) then yes you need a normal ups , with an adapter so it can fit a plug for the wireless router and your charger . they don't cost much and should last for at least 15-20 minutes if only used for the laptops charger and wireless router. getting an adapter from the general computer power socket to the normal power socket should be a bit hard , if you cant find any tell me .
ijanawra wrote]do these cuts affect it in the long term?
from an "electrical" point of view , its as if you removed the charger then plugged it back in two minutes later , the charger is a power transforms and its purpose is to convert the normal 220V AC into some low voltage DC , so it will not be affected by the cuts , and there is absolutely no harm to the MAC , if there is something to blow it will be the charger not the mac :P