<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>Douglas F Shearer - Coding posts</title>
    <link>http://douglasfshearer.com/coding</link>
    <description>Coding posts by Douglas F Shearer</description>
    <language>en-us</language>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/douglasfshearer/coding" type="application/rss+xml" /><feedburner:browserFriendly></feedburner:browserFriendly><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <title>Easy_Install Leopard bug: No Eggs Found</title>
      <description>&lt;p&gt;Today I came across &lt;a href="http://www.zedshaw.com/&amp;#39;s"&gt;Zed Shaw&lt;/a&gt; latest awesome project, &lt;a href="http://lamsonproject.org/"&gt;Lamson&lt;/a&gt;, an Python mail server that isn&amp;#8217;t stuck in the past. &lt;a href="http://www.theregister.co.uk/2009/07/03/lamson/"&gt;The Register&lt;/a&gt; has a pretty good rundown on it if you want to know more.&lt;/p&gt;
&lt;p&gt;So anyway, on installing it, one of it&amp;#8217;s dependences, the &lt;a href="http://jinja.pocoo.org/2/"&gt;jinja2&lt;/a&gt; templating engine, exposed a &lt;a href="http://bugs.python.org/setuptools/issue4"&gt;bug in easy_install&lt;/a&gt; that seems to be quite prevelant on OS X 10.5 Leopard. The error message will be something like &lt;code&gt;No eggs found in /foo/bar/etc (setup script problem?)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The solution is to upgrade to the latest version of easy_install as so:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo easy_install http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c9-py2.5.egg&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Best to check the &lt;a href="http://pypi.python.org/pypi/setuptools#using-setuptools-and-easyinstall"&gt;project page&lt;/a&gt; to see if a newer version has be released.&lt;/p&gt;
&lt;p&gt;Credits: A similar older fix by &lt;a href="http://sean.lyn.ch/2008/08/easy_install-bug-in-leopard/"&gt;Sean Lynch&lt;/a&gt; with a non-working patched upgrade.&lt;/p&gt;</description>
      <author>Douglas F Shearer  noreply@douglasfshearer.com</author>
      <pubDate>Fri, 03 Jul 2009 22:57:05 +0000</pubDate>
      <link>http://douglasfshearer.com/blog/easy_install-leopard-bug-no-eggs-found</link>
      <guid>http://douglasfshearer.com/blog/easy_install-leopard-bug-no-eggs-found</guid>
    </item>
    <item>
      <title>Flic.kr - Flickr Short URLs Explained</title>
      <description>&lt;p&gt;Flic.kr links recently began appearing on &lt;a href="http://twitter.com"&gt;Twitter&lt;/a&gt; and around the web, so I did a little bit of digging. Twitter has brought about a wild storm of URl shortening services, and some issues surrounding them. &lt;a href="http://duncandavidson.com/2009/04/everybody-wants-short-links.html"&gt;James Duncan Davidson&lt;/a&gt; has a good summing up of these, and some of the solutions.&lt;/p&gt;
&lt;p&gt;One of these solutions is to use a link tag on a page to give an alternative short &lt;span class="caps"&gt;&lt;span class="caps"&gt;URL&lt;/span&gt;&lt;/span&gt;. &lt;a href="http://flickr.com"&gt;Flickr&lt;/a&gt; has started to support this, as so&amp;#8230;&lt;/p&gt;
&lt;p&gt;On a photo page, say &lt;a href="http://www.flickr.com/photos/douglasfshearer/3447346323/"&gt;http://www.flickr.com/photos/douglasfshearer/3447346323/&lt;/a&gt;, we find in the source:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
&amp;amp;lt;link rev="canonical" type="text/html" href="http://flic.kr/p/6fCxXz" &amp;amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Twitter clients can now take a pasted Flickr link, and go look up this &lt;a href="http://flic.kr/p/6fCxXz"&gt;short&lt;/a&gt; url on the Flickr page, without making use of a third party service such as &lt;a href="http://tr.im"&gt;tr.im&lt;/a&gt;. Good stuff.&lt;/p&gt;
&lt;p&gt;This also works for user accounts, as an example, mine would be &lt;a href="http://flic.kr/douglasfshearer"&gt;http://flic.kr/douglasfshearer&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Tools&lt;/h3&gt;
&lt;p&gt;The short photo &lt;span class="caps"&gt;&lt;span class="caps"&gt;URL&lt;/span&gt;&lt;/span&gt; is the photo ID converted to Base58, so you need to turn one into the other.&lt;/p&gt;
&lt;p&gt;The item that really brought this to my attention was &lt;a href="http://speirs.org"&gt;Fraser Speirs&lt;/a&gt; &lt;a href="http://gist.github.com/101674"&gt;Base58Encode Objective-C class&lt;/a&gt;, ideal for those of you making Twitter clients.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve released a RubyGem for this, &lt;a href="http://github.com/dougal/base58/"&gt;Base58&lt;/a&gt;, and a &lt;a href="http://gist.github.com/102456"&gt;&lt;span class="caps"&gt;&lt;span class="caps"&gt;CLI&lt;/span&gt;&lt;/span&gt; script&lt;/a&gt; that takes a flickr &lt;span class="caps"&gt;&lt;span class="caps"&gt;URL&lt;/span&gt;&lt;/span&gt; and gives you the short version.&lt;/p&gt;</description>
      <author>Douglas F Shearer  noreply@douglasfshearer.com</author>
      <pubDate>Sat, 25 Apr 2009 21:39:54 +0000</pubDate>
      <link>http://douglasfshearer.com/blog/flickr-flickr-short-urls-explained</link>
      <guid>http://douglasfshearer.com/blog/flickr-flickr-short-urls-explained</guid>
    </item>
    <item>
      <title>Acts_As_indexed v0.5.0 Released</title>
      <description>&lt;p&gt;My &lt;a href="http://douglasfshearer.com/blog/rails-plugin-acts_as_indexed"&gt;Acts_as_indexed&lt;/a&gt; plugin has been updated to version 0.5.0.&lt;/p&gt;
&lt;p&gt;New in this version is:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Ruby 1.9 and Rails 2.3 compatibility.&lt;/li&gt;
	&lt;li&gt;Index location can now be set. Provides &lt;a href="http://heroku.com/"&gt;Heroku&lt;/a&gt; compatibility.&lt;/li&gt;
	&lt;li&gt;Better errors on bad options.&lt;/li&gt;
	&lt;li&gt;ActiveRecord order argument overrides ranking returned by find_by_index.&lt;/li&gt;
	&lt;li&gt;Various test environment improvements&lt;/li&gt;
	&lt;li&gt;Various Bugfixes&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Get it on &lt;a href="http://github.com/dougal/acts_as_indexed"&gt;Github&lt;/a&gt; or view the &lt;a href="http://douglasfshearer.com/rdoc/acts_as_indexed/"&gt;RDoc&lt;/a&gt;.&lt;/p&gt;</description>
      <author>Douglas F Shearer  noreply@douglasfshearer.com</author>
      <pubDate>Fri, 24 Apr 2009 20:08:54 +0000</pubDate>
      <link>http://douglasfshearer.com/blog/acts_as_indexed-v050-released</link>
      <guid>http://douglasfshearer.com/blog/acts_as_indexed-v050-released</guid>
    </item>
    <item>
      <title>Testing Custom Rails Validations with Shoulda</title>
      <description>&lt;p&gt;In this post, I&amp;#8217;ll show how to write custom validations for Rails&amp;#8217; models, and how to test them with &lt;a href="http://www.thoughtbot.com/projects/shoulda"&gt;Shoulda&lt;/a&gt;, the &amp;#8216;Makes tests easy on the fingers and the eyes&amp;#8217; testing plugin.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://rubyonrails.org"&gt;Rails&amp;#8217;&lt;/a&gt; ActiveRecord validations are great when you want to make sure attributes are the way you want them. But what about the use-cases where you need to write a custom one?&lt;/p&gt;
&lt;h3&gt;Creating the Validation&lt;/h3&gt;
&lt;p&gt;The validation we&amp;#8217;ll write is called &lt;code&gt;validates_positive_or_zero&lt;/code&gt;, which will return an error if a relevant integer attribute is negative.&lt;/p&gt;
&lt;p&gt;Create the file &lt;code&gt;RAILS_ROOT/lib/validations.rb&lt;/code&gt; with the following contents:&lt;br /&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
def validates_positive_or_zero(*attr_names)
  # Set the default error message.
  configuration = { :message =&amp;amp;gt; "Cannot be negative" }
  
  # Set a custom error message if there is one.
  configuration.update(attr_names.pop) if attr_names.last.is_a?(Hash)
  
  # Check none of the object's attributes are negative.
  validates_each attr_names do |obj, atr, val| obj.errors.add(atr, configuration[:message]) if val &amp;amp;lt; 0 end
end
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Note: This particular validation is complementary to &lt;code&gt;validates_numericality_of&lt;/code&gt;, you&amp;#8217;ll get some odd failures if you don&amp;#8217;t use it.&lt;/p&gt;
&lt;p&gt;We need to &lt;code&gt;require&lt;/code&gt; this file before we can use the new validation in our model:&lt;br /&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
class Badger &amp;amp;lt; ActiveRecord::Base
  require 'validations'
  
  validates_numericality_of :age, :height, :weight
  validates_positive_or_zero :age, :height
  validates_positive_or_zero :weight, :message =&amp;amp;gt; 'no-one is that light'
end
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The first &lt;code&gt;validates_positive_or_zero&lt;/code&gt; validates two attributes at once, whereas the second validates only one attribute with a custom error message.&lt;/p&gt;
&lt;h3&gt;Testing the Validation&lt;/h3&gt;
&lt;p&gt;I feel I should give a little introduction to Shoulda, it&amp;#8217;s one of those tools that leaves me wondering how I ever managed before. Despite the popularity of &lt;a href="http://rspec.info/"&gt;RSpec&lt;/a&gt; within the Ruby community, I&amp;#8217;m not a fan, it&amp;#8217;s just too verbose, which I find gets in the way (it doesn&amp;#8217;t render views though, which makes functional testing a lot easier, this feature for standard Rails tests please!). Shoulda is the answer for those of us who want standard Rails tests, but with them being neater and tidier. I encourage you to check it out more fully, but for this example, I&amp;#8217;ll stay on-subject.&lt;/p&gt;
&lt;p&gt;For our custom validation we could test it in the regular fashion with a test_foo method, or we could write a custom method that we could use again and again without re-writing the same code. The latter is the approach we are going to take here, with the method being in the style of the other shoulda validation tests.&lt;/p&gt;
&lt;p&gt;First up, install the Shoulda plugin:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;./script/plugin install git://github.com/thoughtbot/shoulda.git&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Next, create the file &lt;code&gt;RAILS_ROOT/test/shoulda_macros/validations.rb&lt;/code&gt; with the following contents:&lt;br /&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
class Test::Unit::TestCase
  
  def self.should_only_allow_positive_or_zero_values_for(*attributes)
    configuration = { :message =&amp;amp;gt; "Cannot be negative" }
    configuration.update(attributes.pop) if attributes.last.is_a?(Hash)
    klass = model_class
    attributes.each do |attribute|
      attribute = attribute.to_sym
      should "only allow positive or zero values for #{attribute}" do
        assert_bad_value(klass, attribute, -1, configuration[:message])
      end
    end
  end
  
  private
  
  # Taken from the shoulda private methods
  def model_class
    self.name.gsub(/Test$/, '').constantize
  end
  
end
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Now we set up our tests in &lt;code&gt;RAILS_ROOT/test/units/badger_test.rb&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
require 'test_helper'

class BadgerTest &amp;amp;lt; Test::Unit::TestCase
  
  # This method is provided by Shoulda.
  should_only_allow_numeric_values_for :age, :height, :weight
  
  should_only_allow_positive_or_zero_values_for :age, :height 
  should_only_allow_positive_or_zero_values_for :weight, :message =&amp;amp;gt; 'no-one is that light'
  
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And we&amp;#8217;re done! I hope this was useful for you.&lt;/p&gt;</description>
      <author>Douglas F Shearer  noreply@douglasfshearer.com</author>
      <pubDate>Wed, 28 Jan 2009 20:26:42 +0000</pubDate>
      <link>http://douglasfshearer.com/blog/testing-custom-rails-validations-with-shoulda</link>
      <guid>http://douglasfshearer.com/blog/testing-custom-rails-validations-with-shoulda</guid>
    </item>
    <item>
      <title>GitHub Bookmarklet Updated</title>
      <description>&lt;p&gt;I&amp;#8217;ve added support for Github&amp;#8217;s repository search and making use of their &lt;a href="http://github.com/blog/309-new-and-improved-search"&gt;new search&lt;/a&gt; to &lt;a href="http://douglasfshearer.com/blog/announcing-github-bookmarklet"&gt;Github Bookmarklet&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Get it&lt;/h3&gt;
&lt;p&gt;Drag this to your bookmarks bar: &lt;strong&gt;&lt;a href="javascript:var%20query%20=%20prompt(%22Search%20GitHub.com%22);var%20user_search_ary%20=%20/^u:(.*)/g.exec(query);var%20code_search_ary%20=%20/^c:(.*)/g.exec(query);var%20repo_search_ary%20=%20/^r:(.*)/g.exec(query);if%20(user_search_ary)%20{window.location%20=%20%22http://github.com/search?type=Users&amp;q=%22%20+%20user_search_ary[1];}else%20if%20(code_search_ary)%20{window.location%20=%20%22http://github.com/search?type=Code&amp;q=%22%20+%20code_search_ary[1];}else%20if%20(repo_search_ary)%20{window.location%20=%20%22http://github.com/search?type=Repositories&amp;q=%22%20+%20repo_search_ary[1];}else%20if%20(query)%20{window.location%20=%20%22http://github.com/search?q=%22%20+%20query;}"&gt;Github Search&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;Repository Search&lt;/h3&gt;
&lt;p&gt;As for user and code-search, but use the r: prefix. You can also use any of the GitHub macros as defined in the blog post linked from above.&lt;/p&gt;
&lt;p&gt;r: will_paginate&lt;br /&gt;
&lt;h3&gt;Docs etc&lt;/h3&gt;&lt;br /&gt;
&lt;ul&gt;&lt;br /&gt;
	&lt;li&gt;&lt;a href="http://douglasfshearer.com/blog/announcing-github-bookmarklet"&gt;Original post&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;&lt;a href="http://github.com/dougal/github-bookmarklet"&gt;Github project page&lt;/a&gt;&lt;/li&gt;&lt;/p&gt;
&lt;/ul&gt;</description>
      <author>Douglas F Shearer  noreply@douglasfshearer.com</author>
      <pubDate>Thu, 22 Jan 2009 23:35:36 +0000</pubDate>
      <link>http://douglasfshearer.com/blog/github-bookmarklet-updated</link>
      <guid>http://douglasfshearer.com/blog/github-bookmarklet-updated</guid>
    </item>
    <item>
      <title>Rails Plugin: Acts As Follower</title>
      <description>&lt;p&gt;Followers are the new friends. Apps such as &lt;a href="http://twitter.com/"&gt;Twitter&lt;/a&gt; and &lt;a href="http://github.com/"&gt;Github&lt;/a&gt; have effectively enabled virtual stalking within their apps. So how can you do this easily without wasting time with your own join tables? &lt;a href="http://github.com/tcocca/acts_as_follower/"&gt;Acts_As_Follower&lt;/a&gt; to the rescue!&lt;/p&gt;
	&lt;h3&gt;Install&lt;/h3&gt;
&lt;p&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;code&amp;gt;./script/plugin install git://github.com/tcocca/acts_as_follower.git&lt;/code&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
	&lt;h3&gt;Usage&lt;/h3&gt;
	&lt;p&gt;A service like Twitter would have a &lt;code&gt;user&lt;/code&gt; model, which would be both a follower and followable&amp;#8230;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  class User &amp;amp;lt; ActiveRecord::Base
    acts_as_follower
    acts_as_followable
  end

  # In the console...
  user1.follow(user2)

  # Get the users following user2
  user2.followers # =&amp;amp;gt; # Array containing user1

  # Get the users user1 is following
  user1.following # =&amp;amp;gt; Array containing user2

  # Check following
  user1.following?(user2) # =&amp;amp;gt; true
  user2.following?(user1) # =&amp;amp;gt; false

  # Stop following
  user1.stop_following(user2)

&lt;/code&gt;&lt;/pre&gt;
	&lt;p&gt;Acts_As_Follower allows heterogeneous follow relationships too, so a user could follow repositories and users, say, in an application like Github.&lt;/p&gt;
	&lt;p&gt;This plugin saved me a lot of time during the start-up of a recent project, and it hopefully should do the same for you. For more usage examples, see the &lt;a href="http://github.com/tcocca/acts_as_follower/tree/master/README"&gt;&lt;span class="caps"&gt;&lt;span class="caps"&gt;README&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;</description>
      <author>Douglas F Shearer  noreply@douglasfshearer.com</author>
      <pubDate>Fri, 21 Nov 2008 19:33:39 +0000</pubDate>
      <link>http://douglasfshearer.com/blog/rails-plugin-acts-as-follower</link>
      <guid>http://douglasfshearer.com/blog/rails-plugin-acts-as-follower</guid>
    </item>
    <item>
      <title>GitHub Bookmarklet Now Supports Code Search</title>
      <description>&lt;p&gt;I&amp;#8217;ve added support for Github&amp;#8217;s new &lt;a href="http://github.com/codesearch"&gt;code-search&lt;/a&gt; feature to &lt;a href="http://douglasfshearer.com/blog/announcing-github-bookmarklet"&gt;Github Bookmarklet&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Get it&lt;/h3&gt;
&lt;p&gt;Drag this to your bookmarks bar: &lt;strong&gt;&lt;a href="javascript:var%20query%20=%20prompt(%22Search%20GitHub.com%22);var%20user_search_ary%20=%20/^u:(.*)/g.exec(query);var%20code_search_ary%20=%20/^c:(.*)/g.exec(query);var%20repo_search_ary%20=%20/^r:(.*)/g.exec(query);if%20(user_search_ary)%20{window.location%20=%20%22http://github.com/search?type=Users&amp;q=%22%20+%20user_search_ary[1];}else%20if%20(code_search_ary)%20{window.location%20=%20%22http://github.com/search?type=Code&amp;q=%22%20+%20code_search_ary[1];}else%20if%20(repo_search_ary)%20{window.location%20=%20%22http://github.com/search?type=Repositories&amp;q=%22%20+%20repo_search_ary[1];}else%20if%20(query)%20{window.location%20=%20%22http://github.com/search?q=%22%20+%20query;}"&gt;Github Search&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;Code Search&lt;/h3&gt;
&lt;p&gt;As for user-search, but use the c: prefix. You can also use any of the GitHub macros as defined on the &lt;a href="http://github.com/codesearch"&gt;code-search page&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;c: badger language:ruby&lt;br /&gt;
&lt;h3&gt;Docs etc&lt;/h3&gt;&lt;br /&gt;
&lt;ul&gt;&lt;br /&gt;
	&lt;li&gt;&lt;a href="http://douglasfshearer.com/blog/announcing-github-bookmarklet"&gt;Original post&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;
	&lt;li&gt;&lt;a href="http://github.com/dougal/github-bookmarklet"&gt;Github project page&lt;/a&gt;&lt;/li&gt;&lt;/p&gt;
&lt;/ul&gt;</description>
      <author>Douglas F Shearer  noreply@douglasfshearer.com</author>
      <pubDate>Mon, 03 Nov 2008 20:36:19 +0000</pubDate>
      <link>http://douglasfshearer.com/blog/github-bookmarklet-now-supports-code-search</link>
      <guid>http://douglasfshearer.com/blog/github-bookmarklet-now-supports-code-search</guid>
    </item>
    <item>
      <title>Announcing GitHub Bookmarklet</title>
      <description>&lt;p&gt;You have to love &lt;a href="http://github.com"&gt;GitHub&lt;/a&gt;! Just last week I was saying to &lt;a href="http://blog.bitfluent.com/"&gt;Kamal&lt;/a&gt; on the phone that I now instinctively search for a project on GitHub before Google, because it&amp;#8217;s likely to be there, and grabbing a copy or just browsing the source is made so easy for me.&lt;/p&gt;
&lt;p&gt;What a shame it&amp;#8217;s an extra few clicks to search it. Until now! Enter the &lt;a href="http://github.com/dougal/github-bookmarklet"&gt;GitHub Bookmarlet&lt;/a&gt;!&lt;/p&gt;
&lt;h4&gt;Install&lt;/h4&gt;
&lt;p&gt;Save the following link as a bookmark, or drag it to the links/bookmarks bar in your browser:&lt;/p&gt;
&lt;p&gt;Over here &amp;#8594; &lt;strong&gt;&lt;a href="javascript:var%20query%20=%20prompt(%22Search%20GitHub.com%22);var%20user_search_ary%20=%20/^u:(.*)/g.exec(query);var%20code_search_ary%20=%20/^c:(.*)/g.exec(query);var%20repo_search_ary%20=%20/^r:(.*)/g.exec(query);if%20(user_search_ary)%20{window.location%20=%20%22http://github.com/search?type=Users&amp;q=%22%20+%20user_search_ary[1];}else%20if%20(code_search_ary)%20{window.location%20=%20%22http://github.com/search?type=Code&amp;q=%22%20+%20code_search_ary[1];}else%20if%20(repo_search_ary)%20{window.location%20=%20%22http://github.com/search?type=Repositories&amp;q=%22%20+%20repo_search_ary[1];}else%20if%20(query)%20{window.location%20=%20%22http://github.com/search?q=%22%20+%20query;}"&gt;Github Search&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;If you get stuck, Delicous have a lovely &lt;a href="http://delicious.com/help/bookmarklets"&gt;guide to bookmarklet installation&lt;/a&gt;.&lt;/p&gt;
&lt;h4&gt;Usage&lt;/h4&gt;
&lt;p&gt;When you click on the bookmarklet, it&amp;#8217;ll give you a text prompt. Type in the name of the project you want to search for, and hit return. You&amp;#8217;ll be taken to the GitHub search page for your query.&lt;/p&gt;
&lt;p&gt;Hitting &lt;span class="caps"&gt;&lt;span class="caps"&gt;ESC&lt;/span&gt;&lt;/span&gt; or Cancel leaves your browser in it&amp;#8217;s previous state.&lt;/p&gt;
&lt;h4&gt;User Macro&lt;/h4&gt;
&lt;p&gt;Want to search for a user? Type in &amp;#8216;u:&amp;#8217; followed by your query. So for instance to look at Kamal&amp;#8217;s github account, I would type in: &lt;code&gt;u:kamal&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Hitting Return or OK now takes you straight to the user&amp;#8217;s Github profile, or shows you a 404 if there is no such user.&lt;br /&gt;&lt;br /&gt;
 &lt;br /&gt;&lt;br /&gt;
h4. Code Search&lt;/p&gt;
&lt;p&gt;As for user-search, but use the c: prefix. You can also use any of the GitHub macros as defined on the code-search page: http://github.com/codesearch. &lt;code&gt;c: badger language:ruby&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;Acknowledgements&lt;/h3&gt;
&lt;ul&gt;
	&lt;li&gt;John Gruber for his &lt;a href="http://daringfireball.net/2007/03/javascript_bookmarklet_builder"&gt;bookmarklet formatting script&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;The GitHub team for, well, Github.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Future&lt;/h3&gt;
&lt;p&gt;If you have any suggestions, send me a message on GitHub, or fork the project and throw me a pull-request once you&amp;#8217;ve made your changes.&lt;/p&gt;</description>
      <author>Douglas F Shearer  noreply@douglasfshearer.com</author>
      <pubDate>Tue, 28 Oct 2008 20:04:33 +0000</pubDate>
      <link>http://douglasfshearer.com/blog/announcing-github-bookmarklet</link>
      <guid>http://douglasfshearer.com/blog/announcing-github-bookmarklet</guid>
    </item>
    <item>
      <title>Acts_As_Indexed now on GitHub</title>
      <description>&lt;p&gt;A few people had been requesting that I moved my &lt;a href="http://douglasfshearer.com/blog/rails-plugin-acts_as_indexed"&gt;Acts_as_indexed&lt;/a&gt; plugin to &lt;a href="http://github.com/dougal/acts_as_indexed"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;
	&lt;p&gt;See the &lt;a href="http://douglasfshearer.com/blog/rails-plugin-acts_as_indexed"&gt;original post&lt;/a&gt; for the new install details.&lt;/p&gt;
	&lt;h3&gt;Pagination&lt;/h3&gt;
	&lt;p&gt;The pagination for this plugin has now been rolled into the release version, no more separate plugin.&lt;/p&gt;</description>
      <author>Douglas F Shearer  noreply@douglasfshearer.com</author>
      <pubDate>Sun, 10 Aug 2008 15:37:48 +0000</pubDate>
      <link>http://douglasfshearer.com/blog/acts_as_indexed-now-on-github</link>
      <guid>http://douglasfshearer.com/blog/acts_as_indexed-now-on-github</guid>
    </item>
    <item>
      <title>JQuery on Rails</title>
      <description>&lt;p&gt;Now, I know I am totally late to the party on this one, but how much does &lt;a href="http://jquery.com/"&gt;JQuery&lt;/a&gt; rock??&lt;/p&gt;
	&lt;p&gt;For several years now I have done all of my JS(JavaScript) stuff using the &lt;a href="http://www.prototypejs.org/"&gt;Prototype&lt;/a&gt; and &lt;a href="http://script.aculo.us/"&gt;Scriptaculous&lt;/a&gt; libraries. I think they&amp;#8217;re pretty awesome tools, and certainly being part of the standard &lt;a href="http://rubyonrails.org"&gt;Ruby on Rails&lt;/a&gt; package has helped them gain a lot of respect and usage.&lt;/p&gt;
	&lt;p&gt;Today I had to do a fairly complex piece of UI prototyping that involved a lot of complex JS. It took me about an hour to do it with Prototype, but I wasn&amp;#8217;t completely satisfied with the results. Some of m fellow &lt;a href="http://zoecity.com"&gt;ZoeCity&lt;/a&gt; devs had been talking about JQuery for a new project we&amp;#8217;ve just started, so I thought I&amp;#8217;d give it a bash. 20 minutes later I had a functional better implementation, with less, neater looking code.&lt;/p&gt;
	&lt;h3&gt;What About Rails?&lt;/h3&gt;
	&lt;p&gt;As I&amp;#8217;ve already mentioned, Rails ships with Prototype, so how do you go about using JQuery in these places? Enter &lt;a href="http://ennerchi.com/projects/jrails"&gt;JRails&lt;/a&gt; by aaronchi. This is a Rails plugin which replaces all the regular Prototype utilizing helpers with JQuery. Sorted!&lt;/p&gt;
	&lt;p&gt;JQuery is stupidly easy to learn, especially for anyone from an &lt;acronym title="Object Orientated Programming"&gt;&lt;span class="caps"&gt;OOP&lt;/span&gt;&lt;/acronym&gt; background, so you should definitely give it a try on your next project.&lt;/p&gt;</description>
      <author>Douglas F Shearer  noreply@douglasfshearer.com</author>
      <pubDate>Fri, 23 May 2008 20:39:17 +0000</pubDate>
      <link>http://douglasfshearer.com/blog/jquery-on-rails</link>
      <guid>http://douglasfshearer.com/blog/jquery-on-rails</guid>
    </item>
  </channel>
</rss>
