Heat a little oil in a wok or heavy-based frying pan. Add the shallots and stir-fry until slightly golden, then add the garlic. Continue stir-frying until the garlic has started to turn golden.
Break the egg into a bowl and beat until the yolk and white are well mixed. Pour into the wok and stir-fry until the egg has set.