Skip to content

Instantly share code, notes, and snippets.

@praveenkumar
praveenkumar / squid.conf
Created June 13, 2016 09:14
squid proxy file (/etc/squid/squid.conf)
#
# Recommended minimum configuration:
#
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
# Auth
auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/squid_passwd
@mhriess
mhriess / friendly_urls.markdown
Created November 13, 2012 19:17 — forked from agnellvj/friendly_urls.markdown
Friendly URLs in Rails

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:

/people/6

But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.