1. In a mixer bowl, combine flour, margarine, sugar, baking powder, and vanilla extract. Blend until the mixture is crumbly. Add egg and blend for another minute until the dough is uniform.
2. To make coffee-flavored cookies, add the coffee granules and blend for another minute. Transfer the batter to a bowl.
3. If desired, add almonds or walnuts and mix in by hand, as so not to crush the nuts. Cover with plastic wrap and refrigerate for an hour.
4. Preheat the oven to 350 degrees Fahrenheit (180 degrees Celsius).
5. Roll out the dough thinly. Cut into squares using a cookie cutter. Place the cookies on a Gefen Parchment Paper lined baking sheet and bake for 15 minutes or until golden.