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
@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
# This is a code example for the Ruby HTTP library Typhoeus
# here's an example for twitter search
# Including Typhoeus adds http methods like get, put, post, and delete.
# What's more interesting though is the stuff to build up what I call
# remote_methods.
class Twitter
include Typhoeus
remote_defaults :on_success => lambda {|response| JSON.parse(response.body)},
:on_failure => lambda {|response| puts "error code: #{response.code}"},
@jrgifford
jrgifford / fatc.html
Created May 26, 2011 12:46 — forked from tomger/fatc.html
a twitter client in stratified javascript ( http://fatc.onilabs.com )
<!DOCTYPE html>
<html><head>
<title>Fork-A-Twitter-Client</title>
<!--
Basic OniApollo/StratifiedJS Twitter Client application scaffold.
See http://fatc.onilabs.com/
THIS FILE IS IN THE PUBLIC DOMAIN.
class Die
def initialize
roll
end
def roll
@numberShowing = 1 + rand(6)
end
@jrgifford
jrgifford / gist:1600874
Created January 12, 2012 14:37
@jrgifford's Ubuntu 11.10 setup.
###### UBUNTU DEVELOPMENT SETUP ######
### Add Sublime Text 2 ###
sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text-2
### Install rvm with railsready ###
wget --no-check-certificate https://raw.github.com/joshfng/railsready/master/railsready.sh && bash railsready.sh
Earthquake.init do
output do |item|
next unless item["_stream"]
if "#{item["user"]["screen_name"]}"!="jrgifford"
notify "#{item["user"]["screen_name"]}: #{item["text"]}"
end
end
end
@jrgifford
jrgifford / keyword.rb
Created January 18, 2012 21:48 — forked from Phize/keyword.rb
keyword plugin for Earthquake(Ruby based Twitter client)
# keyword plugin
# ====
#
# config example:
#
# Earthquake.config[:keyword] = {:pattern => /ruby|rails|earthquake/i}
#
Earthquake.init do
_ = config[:keyword] ||= {}
_[:notify] = true if _[:notify].nil?