GEdit: Snippets for Ruby on Rails

I’ve just created a new GitHub repo with GEdit snippets for Ruby on Rails. Any suggestions and comments are welcome. To install them simply copy the xml files to your ~/.gnome2/gedit/snippets directory.

Refs:
GEdit
GEdit Snippets Plugin

Advertisements
GEdit: Snippets for Ruby on Rails

Ubuntu: Disable That Annoying Touchpad Click

In my opinion, one of the worse inventions since “PC”, is the annoying (and I’m been respectful) Touchpad. Not only it takes you out of your home row (keyboard), or the fact that you need like two passes for reaching corners. But because it really &*^#$%^*$ annoys me when typing accidentally make a click.

Lucky me… there’s a way to disable Touchpad-Click. Simply go to System > Preferences > Mouse, click on Touchpad tab, and uncheck: Ennable mouse clicks with touchpad.

So long Touchpad-click!!!

Ubuntu: Disable That Annoying Touchpad Click

Git: Adding a Ruby on Rails Project to Git

Here’s how to add a recently created Ruby on Rails project to git:

1. Create your new project:

$ rails -d mysql project_name

2. Create some .gitignore empty files so you save the entire structure of your project (git doesn’t include empty folders):

$ touch db/.gitignore lib/.gitignore log/.gitignore tmp/.gitignore vendor/.gitignore

3. Create a new .gitignore file in the root directory of your project with the following content:

log/**/*
tmp/**/*
db/schema.rb

Note: If you are using sqlite add db/*.sqlite3 to .gitignore so you do not have the database into the repository (you can db:migrate it whenever you need it). Thanks for your reply Piku.

4. Initialize local repository:

$ git init

5. Add the project files and make que initial import:

$ git add .
$ git commit -a -m "* Initial import"

6. Finally if you have a gitosis server you can add it with the following commands:

$ git remote add origin git@YOUR_SERVER_NAME:project_name.git
$ git push origin master

That’s it, your project sources are now managed by git.

Happy hacking!

Git: Adding a Ruby on Rails Project to Git

La Blogotheque (a.k.a. Take-Away Shows)

Last week I made a great discovery on the net (at least great for me), a music video blog named La Blogotheque (http://www.blogotheque.net/ – french) – a.k.a. Take-Away Shows the English version (http://www.blogotheque.net/takeawayshows/).

What makes this site so great?

These guys have a concept of meeting new bands (or not so new) and take it to the street, recording the video in one single shot. What is even better is that the results are amazing, the songs are actually better than the originals most of the time. The bad, there’s no way to buy all that unedited, fresh, and great material. You can download the video during the next week after publish date.

Give it a try, you will not regret.

best!

La Blogotheque (a.k.a. Take-Away Shows)

Texinfo: Writing Plain Spanish

After a few weeks of researching we finally decided for Texinfo as our technical writing platform of choice. But before we did the switch, there was a serious complain about Texinfo: The inability to write plain spanish!!!

For us results really odd to write @’a for an a with accent, we still prefer á. So we found a workaround from Vladimir Támara (http://www.geocities.com/sl_edu_colombia/soluciones/vladimir/linux_esp.html), that used sed to replace all accents in our original texi file.

So here’s the howto:

Step 1

Create a file called encodetexi.sh (or name it whatever makes sense for you), and put the following bash code in it:

#!/bin/bash
sed -f <b>encondetexi.sed</b> $1 &gt; tex/$1

This script will encode your accents to the formal Texinfo way with sed, and put them in the subdirectory tex/ (don’t forget to create it or change the script to handle the new subdir creation).

Once created give execute permitions to the script:

chmod 775 encodetexi.sh

Step 2

Create a file named encodetexi.sed which contains the substitution patterns for sed. Here is the content of the file:

s/á/@'a/g
s/Á/@'A/g
s/é/@'e/g
s/É/@'E/g
s/í/@'{@dotless{i}}/g
s/Í/@'I/g
s/ó/@'o/g
s/Ó/@'O/g
s/ú/@'u/g
s/Ú/@'U/g
s/ñ/@~n/g
s/Ñ/@~N/g
s/ü/@\"u/g
s/Ü/@\"U/g

This will replace all accents, tildes, etc. from our original texi file and create a well encoded file in tex/ subdir.

Step 3

Now plunge your texi files in plain spanish, use accents and tildes at will.

Step 4

Run the script (again, make sure you got tex/ subdir):

$ encodetexi.sh your_file.texi

Final thought

Funny… after revisiting this post it would make much more sense to be written in spanish :|

Texinfo: Writing Plain Spanish