Categories
MAC Tutorial

Let the mac sleep

How to turn off/sleep OS X Mac Screen. It took me a lot of researching on internet to find these shortcut keys.

Sleep immediately (no confirmation): Cmd-Opt-Eject
Put display to sleep: Ctrl-Shift-Eject

Categories
Emacs Programming Technology Tutorial

Power Programming with Tags

Source tagging is very powerful source code navigation system, it beats any state of the art IDE. If you are using Emacs, Vim and TextMate then you can use source tagging for navigation. Here are the few simple steps to do it.

Step 1. Install ctags in your system. For mac

$ sudo port install ctags

Step 2. Create A tag file

$ cd /Users/username/Workspace/rails-project
$ ctags -e -a --Ruby-kinds=+f -o TAGS -R app/ lib/ config/

It is best to add this in crontab for this around 11:30am

Step 3.1 emacs

M-. Follow a tag
M-* Jump back to source.

Step 3.2 vim
just add this in your ~/.vimrc

set tags=TAGS;/

Once this is done you can navigate to source of tag by using.

C-] - go to definition
C-T - Jump back from the definition.
C-W C-] - Open the definition in a horizontal split

Hope you will be able to use this awesome feature.
C is ctrl
M is Meta/Alt/Ecs

Categories
Programming Web

Prevent Googlebot following links in Gmail

How to prevent googlebot following links in gmail messages? Well bad news is “Googlebot is following links sent to subscribers of a mailing list by email and it is causing those subscribers to receive an unsubscribe meesage or a added download from the list or server”.

Bigger Bad news is that age old trick will NOT work here, we can not solve this simply by adding

<a href="signin.php" rel="nofollow">sign in</a>

Best way in my opinion is to reject download count based on the user agent. Which is Googlebot in case of Google Crawler.

find long answer here.

 

Categories
Emacs

Searching in Buffers with Occur Mode – Emacs

I mostly work on Terminal or Emacs buffer.  I love emacs. Significant part of my work involves searching for a piece of code. Occur mode is similar to grep-find and find-grep. Just that I only search for the buffers which are open.

For more info go here:

Searching in Buffers with Occur Mode | Mastering Emacs

Categories
Uncategorized

Tmux – Gnu Screen alternative

I am an ancient user of Gnu Screen. I am the one who will suggest new users use these better tools for servers. Gnu Screen is an excellent tool, but It is tough to configure and learn.

Recently I found a replacement. The Tmux!
Tmux is very easy to use. The best part is the shortcuts. 🙂

To install it in mac do

$ brew install tmux

on ubuntu

$ sudo apt-get install tmux

You can put your setting in ~/.tmux.conf

# set -g default-terminal "xterm-color" 
set -g terminal-overrides 'xterm*:[email protected]:[email protected]'

This should be enough to get you started. Google for Tmux cheat sheet to know popular shortcuts. Here is one of them. http://cheat.errtheblog.com/s/tmux

Categories
Customization Programming

Stop doing!

If you keep on doing what you’ve always done, you’ll keep on getting what you’ve always got.

W. L. Bateman
Categories
Asides

Can your editor ?

Can your RoR editor run a web server inside itself, then capture the errors and hop to the error line in code.

Well Emacs with Rinari and ruby mode can do magic. You should checkout  Emacs Wiki.

Categories
Asides

balaclava

I am dieing for a balaclava. Where can I find it in Pune. Does anybody know any really good biking apparel shop.

Categories
Gallery

Photo shoot

Recently Jai came to pune. He is a hell of a photographer. I have used many of his amazing photos on my blog. Here are few shots from his Cannon 1000D with Cannon 50mm prime lens.

If you are unsatisfied with the resolution here, and want to view these in full resolution, view them on Flickr here

Categories
GPL Linux Software Windows

Firefox Sync

Firefox Sync. formally weave. I always wanted that I can continue my Firefox session from one place to anther. You don’t need to save password, you don’t have to save you history through Google Toolbar. You wont need bookmark addons. This is simply great. How many times did you left your computer at work on/hibernated because you thought you will loose your tabs(currently open sites). Sync currently supports continuous synchronization of your bookmarks, browsing history, saved passwords and tabs.