1shallotor red onion - giving 3 tablespoon chopped
If your beans aren't already trimmed, trip the stem end off them. You don't need to bother trimming the narrow end.
Mince the shallot/onion as fine as you can - basically very finely dice then chop a little further to be very fine. Finely grate or mash the garlic.
Bring a pot of water to a boil and add a pinch of salt. Add the beans and cook for 1 - 2 minutes until just tender then remove and either run under cold water or put in a bowl of iced water. Drain the beans and set aside.
Warm a small-medium skillet/frying pan over medium heat and add the butter and oil. Once the butter has melted and is starting to sizzle, add the shallot and cook for around 2 minutes until the shallot has softened and gone translucent.
Add the garlic and mix through to distribute it evenly (I sometimes find kind of mashing it in works best) and cook for another 30 seconds. Then add the blanched beans and toss in the shallot-garlic mixture so they become coated. If you have been using a spatula up to this point, I find changing to tongs can help get them evenly coated. Cook, moving around relatively regularly, for around 1 - 2 minutes then serve.
While this recipe is intended for French-style beans (haricots verts) you could also use other green beans/string beans, just cook for an extra minute or two when boiling to help them soften.