Skip to content

Instantly share code, notes, and snippets.

View onurozkan's full-sized avatar

Onur Özkan onurozkan

View GitHub Profile
@jotapepinheiro
jotapepinheiro / slugUrl.sql
Created April 10, 2012 04:35
SLUG URL POSTGRE FUNCTION
CREATE OR REPLACE FUNCTION public.url_slug (
s_texto text
)
RETURNS varchar AS
$body$
DECLARE
total integer;
BEGIN
s_texto := replace(s_texto , 'U$', 'dolares');
s_texto := replace(s_texto , 'R$', 'reais');
@hugoware
hugoware / mappath.node.js
Created December 24, 2011 15:55
Node.JS MapPath function
module.exports = {
//resolves the root of the site
map_path: function(path) {
return path.replace(/^~/, global.process.env.PWD);
},
//resolves the path and performs a require
require: function(path) {
@mislav
mislav / pagination.md
Created October 12, 2010 17:20
"Pagination 101" by Faruk Ateş

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