My number one tip for avoiding munching away all night is distraction. Do something else, preferably something you can't do while eating. Knitting and painting are both good for this. An even better method is to get yourself away from the food. Go for a walk if the weather is fine enough.
Putting off eating food can help too. If you feel like eating something but you're not hungry, tell yourself you can have it in twenty minutes. By the time twenty minutes comes around you may find the feeling has subsided, or you've been distracted by other things.
Or have a bottle of water near you. Often when we think we're hungry it's actually thirst. It will also give you something to put in your mouth that has no calories! Herbal teas are also good for this.
Or stock up on fruit. Tell yourself you're allowed to snack, but only on the fruit you have if it's in between meals. It's a good way of telling if you are really hungry or not. If you are desperate for something to eat, but won't have an apple, then you know it's not hunger you're trying to satisfy.
Another tip is to paint your nails (if you're into that sort of thing!) You can't eat while your nails are drying. So if you give your nails a couple of coats that's a good half hour when you cannot snack.