A MP4 to PSP Ruby Script

Posted by Vince Wadhwani on Jun 30, 2008 in | ruby | gadgets

About a month ago I wrote a post about converting Railscasts to PSP video using a simple bash script. Well, with the help of my friend Lou, it's now been converted to a Ruby script instead. The files are posted at Github and the public clone url is git://github.com/vince/mp4-to-mobile-video.git so feel free to hack at it and improve it in any way you like. For those too lazy to check out the code, there's a copy/paste version (which of course will not be updated..) below.

In particular I'm posting this to help those familiar with Ruby get started with Ruby scripting since there are some methods you may not have used before if you've only used Ruby via Rails programming.

Continue reading...

Install Sphinx & Thinking Sphinx in Debian

Posted by Vince Wadhwani on Jun 28, 2008 in | gnu/linux | ruby

I've been using Ferret to do searches in BuyIndie for a quite a while now. It works ok but I know there are better solutions out there. One of those that I'm experimenting with is Sphinx. If you want to play along and install it along with the Thinking Sphinx plugin, here's how you do it.

Continue reading...

Quick Tip: Shoes and text

Posted by Vince Wadhwani on Jun 28, 2008 in | ruby

I'm starting to use Shoes for a project I'm working on. I've never done used it before so this is all new. Going through the tutorials page I ran into one called Running with Shoes. Problem was I couldn't get the basic code running. The error I got was a daunting one considering I had only 12 lines of code.:

undefined method 'text' for app

Continue reading...

Ruby Gems 1.2.0 is out

Posted by Vince Wadhwani on Jun 22, 2008 in | ruby

Looks like there's a new version of Ruby Gems available. If you've already got gems installed you can update to the latest version just by running this:



sudo gem update --system

Full release notes courtesy of Eric Hodel can be found here

Quick Tip: Set table width in HAML

Posted by Vince Wadhwani on May 18, 2008 in | html/css | ruby

My HAML adventures continue. This time, I'm documenting how to limit the length of a table or table cell. Usually I'd just do something like

 <td width = "500px">

but with HAML you've got to take a different approach. Fortunately it's not that hard:

 %td{:width => 20}=My cell contents

Continue reading...

Introducing a new Gedit Plugin: Find in Files

Posted by Vince Wadhwani on May 06, 2008 in | gnu/linux | ruby

Regular readers know that I've been using Gedit to do most of the text editing now that I've put away my mac in favor of linux. Leaving Textmate was really hard but luckily there are a few great plugins that help smooth the transition. One of the things that was still missing was an easy way to search for code within my project. There is a Find in Documents plugin but it only searches in documents that you already have open. I decided to modify that plugin to create a new one called Find in Files. Read on for the link and to learn a bit more.

Continue reading...

Install Ruby on Rails on Ubuntu Hardy Heron 8.04

Posted by Vince Wadhwani on Apr 28, 2008 in | gnu/linux | ruby

I recently had to do a fresh installation of Ruby on Rails and Nginx/Mongrel on Hardy Heron server. I compared notes with my last HowTo along the way and decided to write it up in case anybody needs help with the process. If you're struggling with installing Rails, follow along and see if this helps. If you want to scale far and wide on your own I'd suggest popping by Ezra's page and checking out his book. The rest of you.. please read on!

Continue reading...

Autocomplete <% %> in Gedit

Posted by Vince Wadhwani on Apr 25, 2008 in | gnu/linux | ruby

If you followed my previous post on using Gedit to do Ruby Rails development in linux you may have discovered the same annoyance I have. Like Textmate, < will auto-complete the > but unlike Textmate pressing <% will still only complete >. That's led to countless errors where I've accidentally created lines of code like:

<%= link_to "Bar", bars_path >

That lack of a proper closing %> naturally throws an error every time. I guess I'm still not over how textmate would do that automatically for me. Anyway, here's how you correct it.

Continue reading...

Quick Tip: Hidden divs in HAML

Posted by Vince Wadhwani on Apr 21, 2008 in | html/css | ruby

I had the chance to play around with haml the other day. Those of you who don't know haml might want to check the above link and come back. For the lazy people, it's basically an alternative markup aiming to make the views more readable or "beautiful". Whether it succeeds or not is not the point of this tip. Rather, if you're using haml, and want to create a hidden div, I'm here to show you how to do it.

Continue reading...

Quick TIp: Multiple orders in a conditions statement

Posted by Vince Wadhwani on Apr 17, 2008 in | ruby

I honestly don't know how I went this long without every having to use this, but since googling for it can be a bit of a hassle, I thought I'd share this tip with you. Let's say you're in a situation where you first have to sort by date and then alphabetically. How do you put two :order's in the condition? Simple:

@foo = Foo.find(:all, :order => 'created_at desc, name desc')

The magic comma in the quotes passes it along correctly. Thanks to AndrewO for saving me the hair pulling.

Older posts: 1 2 3 ... 8