Friday, 13 March 2009

RE07.US Update: Expiring URL & Widgets

RE07.US continues to make me smile. Last night’s update added a couple neat things;

  • URLs now auto-expire after 5 minutes, yes, there’s also a timer.
  • Usage data; referer, user agent, etc is now being captured.
  • and finally, I’m testing out the RE07.US javascript widget for displaying the RE07.US link on your blog.

I’ve got some ideas on where this technology could be useful, if you do as well, leave a comment.

Sunday, 8 March 2009

Introducing: RE07.US – The Greenest URL Shortener

re07

According to a recent post by FuelInteractive.com, a link in Twitter is clicked for 5 minutes, then completely ignored.

That got me thinking about all the wasted short urls out there. So many tinyurl, culld.us, is.gd, et al, links just collecting dust after all that initial clicking.

Seems so wasteful considering “the current economic climate”. Maybe, we don’t need all those URLs. Maybe we should tighten our belts and limit ourselves to 1 short url – and continually reuse it.

With that in mind, I built HTTP://RE07.US. It’s 1 short url that we can all share.

All long URLs get shortened to the same link: RE07.US. And, it will be shortened to that – until someone else shortens their long URL to RE07.US. And so on and so on.

REDUCE. REDIRECT. RECYCLE.

Saturday, 21 February 2009

The New Project Setup Checklist

As I mentioned earlier, one of my goals for this year is to launch 2 revenue-generating projects. I took a couple hours this morning and started the ball rolling on 2 of the potential candidates to fulfill that goal.

Here’s the checklist I use to lay the foundation for a project:

  1. Declare a descriptive code name
    A good code name (aka working title) has 3 characteristics; articulate the interesting aspects of the project, define the personality of the project, and be completely disposable. The original code name for Cullect was ‘FeedSeeder’. While ‘FeedSeeder’ worked for defining and building the system – it’s a horrid name. The code name for one of the projects inspiring this post is ‘cashboard’, which leads me to..
  2. Create a place for the project
    For me, this means creating a directory in my projects directory (~/Documents/Projects/) and an iCal calendar titled [code-name].
  3. Buy a good domain name
    If anything, the search for a good domain name confirms the need for a disposable code name. I search for domain names after I’m sure I’m serious about the project, though again, this might not be the final project name – Cullect was almost called ‘seedacres.com’ (again, bleeech). Once I’ve got the domain name, I usually dispose of the code-name and re-do Step 2 for the domain name.
  4. Set up the website and email at that domain
    For me, this means creating a ‘garrick@…’ user and installing WordPress on one of my servers at Joyent. This could also mean pointing a WordPress.com account at your domain, or something similar.
  5. Set up the Twitter account for that domain name.
    Finding a Twitter username can be as tricky as finding the domain name, and definitely stay as close to the domain name as possible. Use the email address you just set up – I even use a variation of it for my non-username Twitter ‘name’. Oh, and be sure to follow yourself 🙂
    Note: Whether or not Twitter is where people will be next year, it’s where they are now. Plus, if your project is a software application – there’s a good chance Twitter could be an interface to it.

Saturday, 3 January 2009

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 for domain names for it. The Code Name thus far has been ‘Cashboard’ – but since it’s not available, it needs to be changed.

QSPress.rb – Quicksilver to WordPress in Ruby

Remember the Quicksilver to WordPress Applescript I wrote a while back?

Well, I’ve ported it to Ruby.

The QSPress.rb works the same as the Applescript version, with a couple of tweaks – you can now set categories, flag if a post should be a draft, and upload files – all from Quicksilver.

The full instructions are in the script itself. Enjoy.

Download QSPress.rb

Thursday, 1 January 2009

iPhoto to WordPress Ruby Script

I maintain a WordPress blog that’s primarily an extension of iPhoto, and the various iPhoto plugins (Photon by Daikini, Photon by Orby, WordPress Export) I’ve tried over the years seem to have stopped being maintained, stopped working, or both.

Which is fine, they never worked exactly the way I wanted them too anyway.

So, I wrote one.

In Ruby, with some help from rb-appscript

Unlike like the other iPhoto export options, this one lives in your Scripts menu and automatically creates (and opens!) a draft post containing all the selected images.

Download send_selected_photos_to_wordpress.rb

“It’s surprisingly short and effective.” – Peter Cooper

Saturday, 8 November 2008

9 Things Cullect Taught Me About Software

  • Forcing people to create an account to use your software is a bug.
  • if you’re not scared to deploy, you’ve stopped caring.
  • Murphy is alive and well.
  • Google and a bookself of technical books can be equally useless.
  • Good software is like an iceberg.
  • if you ask for money, people will give it to you.
  • Software is as hard as you make it. Don’t.
  • Most features can be removed and no one will notice.
  • A great project will eat everything in it’s path.

Friday, 31 October 2008

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 caching make less sense when the ‘heaviest’ data are also the most dynamic – the feed items.

For the feed items, I’m using a building a custom memcached name-value-pair holding 10 attributes describing the request as the key name and the items themselves as the key value.

From the ‘show’ action in my controller:

key = "
#{item_count}:
#{attribute_1}:
#{attribute_2}:
#{attribute_3}:
#{attribute_4}:
#{etc...}"

Notice the first attribute in the key is the total number of items within a specific Cullect Reading List – which will change when a feed updates or an item is hidden – automatically expiring stale caches.

Then, I check the cache for the key and pull the items from the cache if it exists.

if Cache.get(key)
@allitems = Cache.get(key)

If there’s no key in the cache, I do the query and put the retrieved items into the cache.

else
@allitems = get_items(attribute_1, attribute_2, attribute_3, attribute_4, etc)
Cache.put key, @allitems
end

While this speeds up subsequent requests, there’s still the question of speeding up the initial request. I’ll save that for part 2.

Wednesday, 24 September 2008

Project Launch: Best Buy Forums

I just got word one of the projects I’m involved with at Best Buy launched today:
Best Buy Forums

The team that pulled it together really ‘gets’ online communities and was a pleasure to work with.

Add this to Remix.BestBuy.com, Giftag, and Blue Shirt Nation, and yeah, there’s a stack of very cool work happening over at the corner of 494 & 35W.

Wednesday, 17 September 2008

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 as a gem…1
gem install --no-ri haml
and a plugin…
haml --rails path/to/your/wiki

2. Create Your Haml View

Open up app/views/show.html.erb
and convert it to Haml. Replacing it to:

.content
%h1= @page.title.gsub('_', ' ')
= link_to('Edit', page_edit_path(:page_title => @page.title))
= link_to('History', page_history_path(:page_title => @page.title))
= "Last Updated #{time_ago_in_words(@page.revisions.last.created_on)} ago by #{Person.find(@page.revisions.last.person_id).name}"
%p= auto_link(@page.revisions.last.parsed_contents)

Now, your wiki should look exactly like it did before we plugged in Haml.

3. Add Haml Support for Revisions

Open up app/models/revision.rb and update def parsed_contents with:

def parsed_contents
contents = contents.gsub(/(w*_w*)/) {|match| "<a href='#{match.downcase}'>#{match.gsub('_', ' ')}</a>"}
h = Haml::Engine.new(contents)
h.to_html
end

4. Try It Out

Load up a page in your wiki, click ‘edit’, and add in some simple Haml, something like:

%strong this should be bold

5. Add in Some More (non-Haml) Formatting

Once you’re comfortable with Haml, maybe add in some other simple formatting rules into revision.rb

#Auto-renders any image URL
contents = self.contents.gsub(/s(.*.(jpg|gif|png))s/, '<img src="1"/>')

# Bolds text inside asterisks
contents = contents.gsub(/*(.*)*/, '<strong>1</strong>')

# Wraps <code> around text inside '@'
contents = contents.gsub(/@(.*)@/, '<code>1</code>')

# Blockquotes text inside double-quotes
contents = contents.gsub(/s"(.*)"s/, '<blockquote>"1"</blockquote>')

# Italicizes text inside underscores
contents = contents.gsub(/s_(.*)_s/, '<em>1</em>')

6. Make it Better

After playing around with Haml and other formatting, you’ll quickly see some quirks – some room for improvement. Go for it, and let me know when you get something interesting.

1. Remember to vendor your gems.