Put garlic into a small pan and roast for 30 minutes.
Rub skins off hazelnuts and almonds. 10 minutes before the garlic is done, add them to the oven in another small pan to roast.
Let garlic and nuts cool, then separate into cloves. Cut the root end off each clove and squeeze out the garlic into a small bowl.
Pulverize the hazelnuts and almonds with a mortar and pestle or in a spice mill, then combine nuts with garlic, tomato, and parsley and process until smooth.
Transfer the mixture to a medium bowl and stir in the cayenne, salt, vinegar, and oil. Cover and allow to stand at room temperature for 2 to 3 hours before serving.