Rinse the salt off of the cod fish. Cover cod with cold water and soak for 24 hours, changing water two or three times. Drain off water. In a saucepan, cover cod with cold water; bring just to a boil. Reduce heat and simmer for 10 to 15 minutes or until tender. Drain, and when cool enough to handle, remove any skin and bones, then shred.
In a saucepan, boil the peeled potatoes in salted water with 2 garlic cloves and hot pepper flakes just until tender. Drain and mash.
In a large bowl, combine all of the ingredients until well mixed using a hand mixer.
Heat frying pan and add a bit of oil. Form a small patty and cook on medium heat. When bottom has colour, flip and finish cooking.
Taste the cake, and adjust the salt and pepper if needed. Continue making the cakes, stirring the mixture often, adding oil as needed. Drain the cakes on paper towels.
Cakes can be served hot or at room temperature.
Note: The pimento paste is available in the international section of a store.