Skip to content

Instantly share code, notes, and snippets.

View jrgifford's full-sized avatar
:shipit:
This is like AIM all over again, isn't it?

James Gifford jrgifford

:shipit:
This is like AIM all over again, isn't it?
View GitHub Profile

Pagination 101

Article by Faruk Ateş, [originally on KuraFire.net][original] which is currently down

One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.

Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o

RAILS_ENV=production rake db:setup
# produces the error below.....hmmm.....it's a no-worky
psql:/yourprojectpath/yourproject/db/structure.sql:29: ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/hstore.control": No such file or directory
# hstore postgresql extension needs to be installed, so....
sudo apt-get install postgresql-contrib
# now your extension should be available to enable so log in with psql
psql -d yourproject_production -U yourdbuser -W
sudo apt-get install phablet-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
apparmor-easyprof apparmor-easyprof-ubuntu aptitude aptitude-common at bzr bzr-builddeb click click-apparmor dctrl-tools debian-archive-keyring debian-keyring debootstrap
devscripts distro-info distro-info-data dput gir1.2-click-0.4 gir1.2-gee-0.8 gir1.2-json-1.0 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl
libclick-0.4-0 libcwidget3 libdistro-info-perl libept1.4.12 libexporter-lite-perl libio-stringy-perl liblttng-ust-ctl2 liblttng-ust0 libparse-debcontrol-perl
libupstart-app-launch2 liburcu1 libxdelta2 pbuilder pbzip2 pristine-tar pybootchartgui python-bzrlib python-configobj python-debianbts python-distro-info python-dns
python-fpconst python-keyring python-launchpadlib python-lazr.restfulclient python-lazr.uri python-lzma python-oauth python-reportbug python-secretstorage
irb(main):001:0> [:thing1 => "thing1", :thing2 => "thing2"]
=> [{:thing1=>"thing1", :thing2=>"thing2"}]
irb(main):002:0> [thing1: "thing1", thing2: "thing2"]
=> [{:thing1=>"thing1", :thing2=>"thing2"}]
irb(main):003:0> [:thing1 => "thing1", thing2: "thing2"]
=> [{:thing1=>"thing1", :thing2=>"thing2"}]
irb(main):004:0>
if node[:scout][:plugin_gems]
gem_package node[:scout][:plugin_gems] do
if node[:scout][:rvm_wrapper]
gem_binary File.join(node[:scout][:rvm_wrapper],"gem")
end
action :upgrade
end
end

Keybase proof

I hereby claim:

  • I am jrgifford on github.
  • I am jrg (https://keybase.io/jrg) on keybase.
  • I have a public key whose fingerprint is C950 AEA2 3127 88D7 470B 67BC C2E0 71AA 27F2 240C

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am jrgifford on github.
  • I am jrg (https://keybase.io/jrg) on keybase.
  • I have a public key whose fingerprint is 1DDA 6D37 9A3F 5643 CB19 43F9 1E3B 896E BFFF 50D3

To claim this, I am signing this object:


# Product Name

1. bullet point
2. list
3. of
4. issues

Screenshots:
@jrgifford
jrgifford / gist:224f26f2144a522fc947
Last active August 29, 2015 14:26 — forked from alexmcpherson/gist:e414f92976f90e6a46a9
Culture for Kapost Bonsai

Practical / Tactical

Be on time to meetings or alert an hour ahead of time if you'll be late

Meetings need a goal and a runner to get that goal accomplished

Defend your time from distractions and use it effectively on moving product forward

Prefer Slack over email over in person interruptions over a set block of time

@jrgifford
jrgifford / pdfx.rb
Last active August 31, 2015 20:55 — forked from fidothe/pdfx.rb
Worked example for creating a PDF/X-1a:2003 document with Prawn
require 'prawn'
require 'prawn/measurements'
# I have a small collection of links to the resources I used to figure all
# this out: http://pinboard.in/u:fidothe/t:pdfx
module PDFX
class PageBox
include Prawn::Measurements
attr_reader :bleed_mm