I started building up new project today, one of the 2 initial revenue generating

I started building up new project today, one of the 2 initial revenue generating projects on my 2009 list. While it’s a way from launching, much of the heavy lifting was completed today. Conceptually, I’ve been using a proof-of-concept of this project for a couple years now. Oh, and I spent waaaay to long looking …

How To Cache Highly Dynamic Data in Rails with Memcache – Part 1

There are a number of ways increase Ruby on Rails performance through caching. Caching works because things don’t change….or don’t change frequently. In Cullect, almost everything is dynamic, even Cullect’s HTML presentation format has 3 different states depending on access privileges and there are 8 other presentation formats available. The standard page, action, and fragment …

Everything Else You Need to Run a Web App

As a reminder on perspective and complexity, here’s the ongoing list of systems I’ve configured for Cullect that aren’t Ruby on Rails: DNS Web Server: robots.txt Web Server: .htaccess Web Server: Virtual Domains Database Server: MySQL Caching Servers: Memcached, distributed across 2 boxes And this doesn’t even crack the surface of the systems Joyent’s Jason …

How To: Build a Wiki with Ruby on Rails – Part 2

Back in Part 1 of Building a Wiki with Ruby on Rails, we built the core wiki engine. Time to add some syntax formatting. These days, I’m pretty enamored of Haml, it’s more like HTML (unlike many other formatting engines) and it’s fast to write (unlike many other formatting engines). 1. Install Haml Haml installs …

How To: Build a Wiki with Ruby on Rails – Part 1

Here’s how to build a very simple Ruby on Rails-based wiki engine 1. 1. Create the Rails App rails wiki and cd wiki to get inside the app. Remember: create your database (i.e. wiki_development) and update config/database.ymlappropriately 2. Generate the Scaffolding There are 3 nouns in this wiki system: People, Pages, Revisions. Let’s create the …

Workaround for IE Overly Accepting in Rails’ respond_to format

Looks like Microsoft’s Internet Explorer will accept any format a web server is willing to give it. This doesn’t play nicely with Rails’ 2.0+ respond_to feature. A slick little bit of code that asks the browser what it wants and replies accordingly. Here’s a conversation between Rails & Firefox Firefox: “Hey Rails, I want this …

Ruby on Rails Snippet for Changing Relative Paths to Absolute

If you have a bunch of text containing relative path hyperlinks, and you’d like to change to them to absolute paths, you might find this snippet helpful. content = “some text with a <a href=’/path/to/relative_link/’>relative link</a>” link = “http://somedomain.com/” content.gsub(/=(‘|”)//, ‘=1*/’).gsub(/*//, link.match(/(http|https)://[w.]+//)[0]) The asterisk ‘*’ is a hackey placeholder for the actual link swapped in …

Parsing Arbitrary XML Namespaces in Ruby with Hpricot

(This post inspired by a Ruby.MN conversation) I’ve burned through at least 3 different XML parsing libraries in building Cullect. I started the built-in REXML (pro: built-in, con: heavy and slow) then moved to FeedTools (pro: easily parses the most common feed formats, con: no longer in active development). I have a lot of love …

Optimization Tips: Ruby on Rails and MySQL

Stop. I’ve uncovered these tips after (at least) the 3rd refactoring effort of some fairly simple, straight-forward Rails code. Rails is great for getting ideas prototyped super fast. These tips will slow down development and make apps less portable. Continue reading only if you’re running a live app in production and not happy with how …