Java
public static void rotate(int[] arr, int by) {
int n = arr.length;
int i = 0;
int j = 0;
while (i < n) {
int k = j;
int value = arr[k];
do {
k = (k + by) % n;
int tmp = arr[k];
arr[k] = value;
value = tmp;
i++;
} while (k != j);
j++;
}
}
Demo here.
Minified Javascript, 114:
function rotate(e,r){n=e.length;i=0;j=0;while(i<n){k=j;v=e[k];do{k=(k+r)%n;t=e[k];e[k]=v;v=t;i++}while(k!=j);j++}}