Skip to content

Instantly share code, notes, and snippets.

@rottmanj
Created February 21, 2014 21:18
Show Gist options
  • Save rottmanj/9143738 to your computer and use it in GitHub Desktop.
Save rottmanj/9143738 to your computer and use it in GitHub Desktop.
total_records = 135
offset = 0
item_per_page
page = 2
offset = (page - 1) * item_per_page
while offset < total_records do
# do something
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment