Wednesday, August 26, 2009

Twitter bookmarklet

Updated version of this bookmarklet is here Twitter bookmarklet


What does this bookmarklet do?

You are reading a great article on the web or you found a great website. Now you want to share it with everyone on twitter. Just click on "TweetThis" bookmark in your bookmarks tab and it will take you to twitter with url already shortened with bit.ly.

Drag this Twitter Bookmarklet to your favorite browser's Bookmarks Toolbar.


Old: TweetThis Check out the latest one below.

UPDATED bookmarklet - includes page title in a your tweet.

New: TweetThis

1. You found a great article on yahoo and you want to share it on twitter. To do this- Click on TweetThis bookmarklet.



2. Once you click on the bookmarklet, it will create bitly url for the webpage and take you to twitter.com to post.


If you want to view what it is doing, check this.

Source code:
javascript:function loadScript(scriptURL) { var scriptElem = document.createElement('SCRIPT'); scriptElem.setAttribute('language', 'JavaScript'); scriptElem.setAttribute('src', scriptURL); document.body.appendChild(scriptElem);}var url = 'http://api.bit.ly/shorten?version=2.0.1&login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&longUrl='+document.location;var longUrl=document.location;loadScript(url+'&callback=tweetme');function tweetme(json){var shortLink = json.results[longUrl].shortUrl;document.location='http://twitter.com/home?status=I+found+this+great+thing+'+shortLink}


Friday, August 14, 2009

Syntax highlighting in vi/vim editor on ubuntu

To turn on syntax highlighting, use this command. :syntax on
When you open any file in vi editor, press escape and enter :syntax on.
Ubuntu by deafult has vim-tiny installed. So syntax command may not work. You may get this message: "E319: Sorry, the command is not available in this version"

ubuntu vi editor screenshot

To install full version of vim, use following command.

$ sudo apt-get install vim
or
$ sudo apt-get install vim-full
You can also check which package is ubuntu using by entering following command.
$ dpkg -l vim*
priyank@priyank-laptop:~$ dpkg -l vim*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=======================-=======================-============================================
ii vim 2:7.2.079-1ubuntu5 Vi IMproved - enhanced vi editor
ii vim-common 2:7.2.079-1ubuntu5 Vi IMproved - Common files
un vim-doc (no description available)
un vim-gnome (no description available)
un vim-gtk (no description available)
un vim-lesstif (no description available)
un vim-nox (no description available)
ii vim-runtime 2:7.2.079-1ubuntu5 Vi IMproved - Runtime files
un vim-scripts (no description available)
ii vim-tiny 2:7.2.079-1ubuntu5 Vi IMproved - enhanced vi editor - compact version

Once you install vim, and open any file using vi/vim editor turn on syntax highlighting by using the commnad given above. You should be able to see your code like this.

Thursday, August 13, 2009

Voyij.com travel deals widget

Latest Travel Deals powered by Voyij

Tuesday, August 4, 2009

UNIX: useful applications list (opensource)

I came across this website - thanks to Bing.
It contains list of applications every UNIX/Ubuntu user should have.
The list includes following categories.
- Audio Applications
- Graphic Design Applications (2D)
- Graphic Design Applications (3D)
- Video Applications
- System Applications:
- Developer Applications
- Productivity Applications
- Web Development Applications

Some the applications that I am using or I have installed are:
GNOME Do
Basket Note Pads
Pidgin
jEdit
Audocity
GIMPshop
Wine
OpenSSH
OpenOffice
Putty
bugzilla
Eclipse
Geany
TrueCrypt