Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
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
import argparse | |
parser = argparse.ArgumentParser(description='Shift a string n chars based on step.') | |
parser.add_argument('--shift', help='shift a string of text') | |
parser.add_argument('--deshift', help='deshift a string of text') | |
parser.add_argument('--steps', type=int) | |
args = parser.parse_args() | |
steps = args.steps |
import gevent | |
from gevent import socket, queue | |
from gevent.ssl import wrap_socket | |
import logging | |
logger = logging.getLogger('irc') | |
logger.setLevel(logging.DEBUG) | |
ch = logging.StreamHandler() |
import feedparser, re #feedparser available at http://feedparser.org/ | |
def search_fatwallet(keyword): | |
fw = feedparser.parse(r'http://feeds.feedburner.com/FatwalletHotDeals') | |
for entry in fw.entries: | |
if re.search(keyword, entry['title']): | |
print entry['title'], '\n', entry['feedburner_origlink'] | |
print '' | |
""" | |
>>> search_fatwallet('car') |
# -*- coding: utf-8 -*- | |
"""Profiling The Evolution of the Python Programmer | |
Based on the code offered in good humor at | |
<http://metaleks.net/programming/the-evolution-of-a-python-programmer>. | |
I thought it would be fun to profile the various approaches to a | |
factorial implementation offered by Aleks. My attempt below. | |
I couldn't profile the EXPERT PROGRAMMERS or the Unix Programmer, as I |
RFC 0001 - Host Software | |
RFC 0002 - Host software | |
RFC 0003 - Documentation conventions | |
RFC 0004 - Network timetable | |
RFC 0005 - Decode Encode Language (DEL) | |
RFC 0006 - Conversation with Bob Kahn | |
RFC 0007 - Host-IMP interface | |
RFC 0008 - ARPA Network Functional Specifications | |
RFC 0009 - Host Software | |
RFC 0010 - Documentation conventions |
#!/bin/sh | |
# | |
# a simple way to parse shell script arguments | |
# | |
# please edit and use to your hearts content | |
# | |
ENVIRONMENT="dev" |
import unittest, os, os.path, sys, urllib | |
import tornado.database | |
import tornado.options | |
from tornado.options import options | |
from tornado.testing import AsyncHTTPTestCase | |
# add application root to sys.path | |
APP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) | |
sys.path.append(os.path.join(APP_ROOT, '..')) |