Heat-treat the raw flour to make it safe to eat by spreading it on a sheet pan and baking for 5 minutes at 350°F/180°C,
Add the butter, sugars, and vanilla to a large mixing bowl. Mix until combined and smooth.
Add in the flour, and mix until well incorporated.
Add in the chocolate chips, and mix again until evenly incorporated.
Break the cookie dough into small pieces, about the size of a pea, varying the sizes if you like.
Store in an airtight container in the freezer or refrigerator.
For the Ice Cream
Chill the ice cream bowl for at least 24 hours or until solid. You should not hear any water sloshing around when you shake the bowl. In a large bowl, combine the heavy cream, whole milk, brown sugar, vanilla extract, and kosher salt.
Whisk for 2-3 minutes, until the sugar is dissolved into the mixture. You should not feel any grit if you rub the mixture together between two fingers.
Churn the ice cream mixture in the bowl of your ice cream machine according to your manufacturer’s instructions (mine took about 25 minutes), until it is thick and the consistency of soft-serve ice cream.
In the last two minutes of the churn, add the mini chocolate chips and cookie dough bites, reserving a tablespoon of each for later.
Spoon the ice cream into a shallow container or a loaf pan. Top with reserved mini chocolate chips and cookie dough bites. Press plastic wrap or wax paper to the surface of the ice cream. Freeze for at least 4 hours, or until solid.
Let sit at room temperature for about 5 minutes before serving.