Entries from November 2008 ↓
November 26th, 2008 — editors, programming, tip
Am I the only one to notice that there is a lot of vim love in the airwaves recently?
I saw the trend very clearly, spanning from reddit to news.yc and let me say that the material that came up recently is very good; those neat posts prompted me to improve my vimrc dramatically and I really like what I learned.
In this installment, instead than annotating my vimrc (another one? not that interesting, I’ll refrain) , I want to compile a roundup of the best vim articles I saw recently.
I’ll also add a few classics that changed me from a hater to a vim lover and will conclude with some minor tips out of my bag.
So here we go with the roundup.
Recent Vim Articles Roundup
Jamis Buck
Vim Follow Up
Coming Home To Vim
Jamis Buck switches back to vim from a period using TextMate and talks about his experience and his configuration. Many useful tips in there.
Stephen Bach
Configuring Vim Right
Sensible defaults for your vimrc, recommended.
Learnr dev blog
Configuring Vim Some More
Some additional configuration options that totally make sense and I incorporated in my config too.
Swaroop C H
A byte of vim
A new free e-book on vim, worth reading. Covers also advanced topics like writing your own plug-ins.
Effective Vim
This ends the recent vim trend spotting. But there are some older links that are worth sharing in my opinion.
Older Vim Gems
Jonathan McPherson
Efficient Editing With Vim
This is a true gem, an intermediate level tutorial that will convert you from a beginner vim user to a way more proficient one.
Jerry Wang
vi for smarties
Very good beginners guide to vim.
David Rayner
best of vim tips
Raw tips from a very long time vi/vim user
Vim is also great for Python development, 3 ideas…
vim omnicomplete awesomeness
How to make vim a modular Python IDE
How to replicate SLIME in vim
Finally a few tips from myself
vimperator: If you’re a heavy vim user you might want to checkout the great Firefox extension vimperator. You’ll find yourself browsing mouse-less with familiar vim keystrokes in a matter of minutes. I love it.
viPlugin for Eclipse: If you’re a Java developer (been there, done that) and you’re stuck with Eclipse, you definitely want to have viPlugin. It makes the Eclipse experience something much more pleasurable for one who has vi keystrokes embedded in the fingers.
cool color scheme: If you’ve seen “some” screen-casts and you have just a subterranean TextMate envy and you can’t stop thinking at that cool color-scheme, well think no more, you can use this one or my humbly tweaked version.
For delicious users here is the page of my bookmarks that made me notice the trend.
Ending note
For full disclosure I have to say that I have been – and still am sometimes – an Emacs user. One of the rebel ones daring enough to use Viper mode. So now you know.
November 21st, 2008 — linux, programming
This is the scenario I was thinking about: I want to interact with a graphic designer remotely, who is very very good with Photoshop and HTML/CSS but who might have trouble setting up the Linux environment needed to run my web app.
What I would like to build (or find if it already exists) is a custom CD that when inserted into a Windows or Mac OSX box does the following:
- Start a virtualbox/vmware instance with my Linux distribution of choice.
- Inside the virtual machine the web app is started automatically in debug mode.
- Proper networking is in place so that the web app is accessible to the host operating system on a specified port.
- The template/media folder of my web app is shared via SMB with the host OS.
This way the graphic designer could work on the templates/design of the application having (almost) zero knowledge of the technology behind and no access to the code.
I have already developed a solution like this for myself using colinux. But the process required quite some fiddling and was all but automatic.
Automated is the keyword.
That’s it.
November 19th, 2008 — programming, startup
One of the first things I implemented for tuttivisti – to add just a hint of viral marketing to the project – was a widget that you can import on your own blog, maybe on the sidebar, to show the latest movies you either want to see or just watched. Let me test it here for you (and for me
):
How does it work? Just go to the goodies page (well login first) select how many columns and how many movies you want to show, click preview, copy the short Javascript snippet into your blog, website, myspace,etc. and you’re done.
I don’t think anybody is using this yet, but it’s understandable, tuttivisti has only a little above 100 users at the moment, most of whom never came back.
We’ll see if adding the next level of viral-ity will improve things: think posting your movies to twitter, pwnce, plurk, friendfeed, facebook, etc…
. I’ll try. I think I’ll start from twitter this week. Pinax supports it out of the box (together with openmicroblogging which is way cool).
November 18th, 2008 — programming, python, tip
In the first installment of this series I’ve spoken about a set of technologies that can speed up the time to market quite a bit. Read about it here if you missed it.
This time I want to talk about where to get the content for your niche web app – if you need a source of content, that is.
Leverage the Semantic Web
I apologize if you all know it and I am late to the news. But really, the semantic web is alive and here and I think one of its most promising incarnations is Freebase.
What is Freebase?
Take the whole of Wikipedia, in it’s unstructured – well I should say semi-structured – mass of data, structure it properly creating schemas on schemas of semantic relations amongst articles, and expose a clean API on top of it. Keep the openness part, allow anyone to create new domains (called bases) and to contribute structured content by hand or programmatically. That is freebase as I understand it. Beautiful.
How did I use it
So the secret is out, that’s exactly what I used to present cool thumbnails and basic movie data for my tiny tuttivisti – now at the second week of life (check it out by the way, the new release is out).
Let me go into deeper depth here because I realize the audience requires it.
The Freebase folks have extensive documentation on how to interact with their service. In addition to that they publish two very nice Python libraries, freebase-suggest and freebase-python. The first to add a cool, jquery based autocompletion dropdown to your forms, the second to query Freebase programmatically from a Python program.
freebase-suggest example
Using the freebase-suggest library is very easy. To achieve this:

I just had to add this jquery snippet to the bottom of the page:
<script type="text/javascript">
var options = {
soft: false,
ac_param: {
type: '/film/film',
category: 'instance',
disamb: '1',
limit: '10'
}
};
$('#searchbox')
.freebaseSuggest(options)
.bind('fb-select', function(e, data) {
$('#searchbox').val(data.name);
$('#freebase_id').val(data.id);
$('#freebase_image_id').val(data.image.id);
$('#search_movie_form').submit();
return false;
});
</script>
And mark the text input of the search with id=”searchbox”.
The freebase-python library is also very easy to use and I encourage you to take a look at the documentation, here.
So in conclusion, before your app gains traction and your content is produced by your users, leverage the Semantic Web if you can, use freebase!
November 12th, 2008 — linux, tip
Say something bad happened and your application sent emails that it shouldn’t have (ahem who? not me…) and you want to collect the emails to apologise. So you just copied the output of a log file in a text file (wrong.txt) like the following:
sending message 'Confirm email address for example.com' to email1@test1.com
sending message 'Confirm email address for example.com' to email2@test2.com
[...]
sending message 'Confirm email address for example.com' to email3@test3.com
Unix command line tools can make the job of extracting those emails and make them ready to be used in a To (or BCC) field a one liner:
cat wrong.txt | awk {'print $9'} | uniq | xargs -I{} echo -n "{},"
The result is:
email1@test1.com, email2@test2.com, [...], email3@test3.com
November 9th, 2008 — programming, tip
Quick one liner to list the ubuntu packages you recently installed on a machine. I needed this to copy the configuration of one of my production boxes onto a dev environment:
sudo cat /var/log/dpkg.log | grep \ installed | awk {'print $5'} | xargs
mysql-client-5.0 mysql-server-5.0 ... apache2
November 9th, 2008 — programming, python, startup, ycombinator
First things first. My new webapp tuttivisti is live!
This post is about how it came to be. In just one week. One person team. Crazy working hours.
So I was there immediately after receiving the news that YC did not select my team for this round. I thought I would feel depressed. I thought that the put down would ruin my mood.
Well it didn’t! I actually felt a jolt of energy. For some reason I felt a bit as if I had been freed. Can’t really explain why but my motivation and excitement bounced back up.
So what did I do with all this creative energy? Well my partner for diffract.me (the other project I am preparing to launch) had to go for a few days back home and we hadn’t planned our next iteration yet. So I decided to dive into something new, short and sweet.
Yep, I started coding. Again. From scratch.
I sat on the shoulders of giants. For this 1 week challenge I picked some of the most productive tools I know (and these will be topic for a future post):
I’d love to communicate properly the productivity boost that the set of frameworks above can give a developer.
No more spending endless hours trying to create a decent CSS/HTML layout. Bluetrip (and by saying Bluetrip I mean also the great Blueprint and Tripoli from which Bluetrip has been created) makes it trivial to put the stuff exactly where you want it on the screen. Cross-browser. No hassle.
Pinax. Ah, the joy. No more coding for the nth time a registration module. No messing with authentication emails. No rewriting another openid library. No more. It’s all there. Ready to use. Greatly structured. Amazing stuff. This is a game changer in my opinion.
Jquery. Well it needs no introduction. Jquery is a work of genius. For me it changed coding in Javascript from a painful experience into a pleasurable one. I love Javascript again.
Now will tuttivisti fly? I sure hope so, but the truth is that it does not matter. What I am saying to myself is: If I can build something like this in 1 week the question is not “will I ever manage to build a webapp that gains some traction?” but “How many attempts will it take? Is 5 going to be enough? 10?”. Maybe.
I have a lot more to say but will cut it short. I am at the end of a very very long and demanding coding spree.
Update: The past weekend a new version of tuttivisti has gone live, my 2nd week of work on the project, which incorporated much of the feedback I received, but a lot of work is still needed. So feedback is welcome, and – yes I know – I need a graphic designer.