GEdit plugin formatting Ruby and ERB code now!

I have published some time ago a GEdit plugin for formatting Ruby code.

Now I just updated the plugin and added support for formatting html.erb and .xml.erb files too.

The main idea  is to make this plugin a generic language code formatter for GEdit, contributions are welcome.

As told before, to install it, grab the source from GitHub and copy all files to ~/.gnome2/gedit/plugins.

To download the files using Git use the following command line:

git clone git://github.com/urubatan/gedit_formatter.git

If you want to contribute just send a pull request in GitHub or send me a patch by e-mail.

To use the plugin, just press CTRL+ALT+F after installing and enabling it.

If you do not have git installed, you can download a tarbal with the latest sources from this link.

If you enjoyed this post, make sure you subscribe to my RSS feed!

GEdit plugin for formatting ruby code


I work with Java for a long time, and I’m used to Eclipse facilities, but to work with ruby on rails I think an IDE is not needed, I work better with GEdit (or even VIM, depends on my humor) than ith NetBeans or Aptana.
But there are some features of an IDE that I miss when working with GEdit, for example code formatting.
As a heavy eclipse user, I prefer to let eclipse take care of the indentation of my source files …
So I have created this GEdit plugin to format ruby files, if you want to use it, just checkout the source code from GitHub and copy all files to ~/.gnome2/gedit/plugins, restart gedit and you are ready to go …
After reopening GEdit, click Edit\Preferences\plugins and enable the “Code Formatter” plugin.
then, when you are editing a ruby file, just click CTRL+ALT+F and the code will be formatted for you.
if you are more a mouse gui, just click Tools\Format Code.

I hope this plugin can be useful for others too.
I plan to add support for more languages, for example XHTML and RHTML (ERB + XHTML), I know tidy plugin can do this, but I do not like the default tidy configuration, but will probably use tidy as a backend to this feature :D

to checkout the code, you can download the zip file available in the project page, or use git:

git clone git://github.com/urubatan/gedit_formatter.git

Any doubts, problems or tips for improvements just leave a comment, here or in github.

PS.: this was my first GEdit plugin, and my first experience with python, the code can be improved a lot, any comments about that are very welcome.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Recording screencasts with Linux (Ubuntu/Kubuntu)

Well, lots of people want to create screencasts with linux but have no idea on how to begin, so I decided to write a little step by step using Ubuntu/Kubuntu, I hope it helps some one.

You’ll see that there are not that many steps :D

  1. To install all the tools we’ll use just run the following command
  2. $sudo apt-get install gtk-recordmydesktop mplayer mencoder ffmpeg
  3. To start recording your screencast, just open the application gtk-recordmydesktop and follow the on screen insctructions
  4. If the recorded video is in a big resolution (in my case 1280×800) you will only be able to play it with mplayer, it seems that Theora have memory issues :D
  5. The recorded video is in Ogg Theora format, that can be played only in linux, there is one decoder for windows only, so lets turn it into something usefull.
  6. $mencoder [file name].ogg -o [file name].avi -ovc lavc -oac lavc
  7. Ready! Now it can be played in any platform :D
  8. You still want to turn it into a screencast or the web?
  9. $ffmpeg -i [arquivo].avi [arquivo].flv
  10. Ready! now we have a Flash Video with streaming support for publishing it on the web, you just need a player.

If you work with flash, you can create your own player, I do not think it will be much trouble, but this is not my case, so I’ll use this open source player that does the job very well! JW FLV Player

Every thing ready! Now you can make your web site full of videos :D

I think this post is the simpler and most useful step by step for creating screen casts with linux that I have seen around the net :D

If you enjoyed this post, make sure you subscribe to my RSS feed!