I’m looking at the Rack::Staging middleware today. This middleware looks like a great idea for staging servers, since it requires all requests to have a valid staging code (cookie). If a user doesn’t have one yet, you can create an HTML page that lets them submit their staging code. The Code 1 2 3 4 …
Tag: code-reading
Daily Code Reading #10 – Rack::ForceDomain
Today’s coderack.org middleware is Rack::ForceDomain. This middleware forces all requests to go to a single domain. This is useful to unite the “www.example.com” and “example.com” domains so they all end up at a single domain. The Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 …
Daily Code Reading #9 – Rack::StaticFallback
Today I’m looking at another rack middleware from coderack.org called Rack::StaticFallback. This middleware is useful in development if you have users upload files to an application and you don’t want to always grab copies of those files when you develop locally. Rack::StaticFallback will rewrite requests to those files and use the actual files from the …
Daily Code Reading #8 – Rack::GoogleAnalytics
Today I’m reading the code for Rack::GoogleAnalytics. It’s rack middleware I found on coderack.org that will automatically insert the Google Analytics tracking code into every page. The Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 …
Daily Code Reading #7 – Rack::MemoryBloat
I’ve decided to skip over the rest of Facets for now in order to read more application code. This week I’m going through some coderack.org examples, starting with MemoryBloat. coderack.org is a collection of Rack middlewares, which are little snippets of code that can be added to any Rails or Rack web application. The Code …