- Firefly URL shortener in less than 2.5 minutes - A screencast of how to clone and deploy the Firefly URL shortener for yourself.
- Rails 3 Upgrade Handbook - With Rails 3 just round the corner, now is the time to start considering what apps you want to upgrade and how.
- sinatra-bundles 0.3 is out - Daniel Huckstep's asset packaging gem for Sinatra now allows you to define your own location for stylesheets and javascript. Check out the full range of features on Github.
About Me
My name is Matthew Lang, and I'm a programmer and Ruby hobbyist based just outside Glasgow in the UK.
Search
My Places
Tags
Snippets #121
Snippets #120
It's amazing what a spot of re-factoring does to simplify your application. I just hope I haven't went too far.
- Sinatra-tests - This gem should come in handy for providing extra tests for my little Sinatra apps.
- Simpleconfig - I'm already using basic configuration settings in a couple of Rails apps, but this gem will make my settings easier to manage and use.
- Ruby 1.9.2 RC1 released - Good thing I'm using RVM.
I also started reading The Passionate Programmer last night. I'm already 50 pages into the book, so I'm aiming to finish it over the weekend. The best part will be putting some of this new found knowledge into action.
New in the incubator - keywordr.rb
The other day I wondered what kind of keywords that websites had been using but I wanted to see them in the context of a search, just like Google's search results. I need a mini-app!
The gist of the mini-app is this.
You key in the query and keywordr will do a search on Google for your query. It will scan through the list of returned results and check each URL in the results for a list of keywords.
Using Sinatra, I was able to put together an application the does this. You can see the latest version of it here.
I did initially want to return the keyword metatag for each website, but I found that Peter Cooper's pismo gem does a keyword search of any URL you pass to it.
What I learned
- Searching a page using Nokigiri's CSS selector - This seems a much easier way of searching a page. I had only used XPath's previously.
- Embedded tests in a Sinatra file - I'm trying to keep my mini-apps in single files, but I wanted to use TDD as well. This was a good place to learn how to embed tests with a single file Sinatra app.
- Some basics of Haml - I tried Haml before but never took to it. Too keep my mini-apps small, I wanted use a more concise and readable syntax for layouts and views. Back to Haml.
What next
- A nice way paging through the next set of results would be nice.
- Being able to get more results on the page would be good.
- I don't like the way I run my tests for the mini-app, but it works for the moment.
I've neglected my little incubator project for sometime, but in the future I'm hoping to add a mini-app every month.
Snippets #99
- Unit and Functional Tests are as Useful as 100% Code Coverage - Interesting comments on this post, but any tests are better than no tests.
- Markupslicer - Handy helper for slicing up HTML markup in ERB and HAML templates.
- Sinatra-Flash - Rail like flash messages for Sinatra. Even though this is an early release, good to see there is plenty of documentation.
Snippets #92
Still haven't nominated someone for Ruby Heroes. There's just too many people to choose from!
- The Lowdown on Routes in Rails 3 - With such a big change in routes I'm going to have to make a point of remembering which Rails version I'm working with in different projects!
- What does "scalable database" mean? - James Golick follows up his previous post about scalability in NoSQL db's.
- All aboard! An introduction to Rails 3 - Good guide to Rails 3 highlighting important parts such as the new single rails command and Bundler.
- SuperDo - A Sinatra and DataMapper To Do List - My favourite post this week.
- Haml/Sass 3 Beta Released! - I tried Haml a few months ago, but never persisted with it. I might give it another try soon though.