While there are definitely better versions, as always I’m concerned with the fundamental function – and for requestAnimationFrame it’s pretty straightforward:

window.requestAnimationFrame = function(callback){
  return window.setTimeout(function(){
    callback(+(new Date()));
  }, 20);
};
window.cancelAnimationFrame = window.clearTimeout;