imdb-rightclick-hack

Was going through the image gallery present in IMDB. Noticed that I could not save the image I was viewing because right-click wasnt working.

There are two ways to save the image in Mozilla Firefox

  1. Click Tools -> PageInfo and in the Media Tab you can find the images and click on the image and click “Save As..”
  2. View the source of the page. Get the image location , copy the url and save the image.

Once one sees the source, one will findout that the contextmenu is being replaced. It looks something like

<img src="imagelocation.jpg" oncontextmenu="return false" />

If its possible for you to change this value in the contextmenu, you can directly get the right-click option enabled. Thinking about the post title, I should have named the title as “How to disable rightclick in Mozilla Firefox ?” . By the way, the code that works removing rightclick in imdb is

javascript:for(i=0;i<document.images.length;i++) if(document.images[i].oncontextmenu)document.images[i].oncontextmenu="";void(0)
 Continue reading 

Vimming

Was coding, and got a different kind of doubt. If I want to search for 2 words both at a time, say, PrimeNo & TotalNo. I found out that oring the two will do it. But we have to escape the | . ` /PrimeNo\|TotalNo` in vim will do it. 🙂

Found a new vim trick :).

That was some time before and today , the 4th of September, found a nice one this time. What will you do if u have a link in your file that you are vimming [the file you opened using vim], What a normal person will do is he would copy the link and paste it in the browser, else, you can just go to that line containing the link and just say `gx` in escape mode, I found this accidentally when pressing :noh , got :no , and then it gave some aliases which are there by default, and this is one of it.

And also one thing about recording in vim, I tried to read about recording in ranta’s page, but I had a doubt when to use it,

and found a incrementer/decrementer in vim :D, just go to a number and press Ctrl+A [Escape Mode] will increase the number and Ctrl+X[Escape Mode] will decrement the number.

i recently knew that recording is easy,good,helpful ,briefly, press `qa` in Escape mode to start recording, this will store all the actions we do within the register `a`, do something and then `q` to stop recording, and executing the contents of the register `a` is by [count]@a .count is no. of times we want it to repeat that action which is commonly used in vim.

.vimrc

+set ai
+set autoindent
+set cindent
+set ci
+map <f5> $vypr|^vyphr|YPVr-jYpVr-j

thinking of writing some pages on pdf/swf/algos 😀 .Jus writing them as found them and may come in handy sometimes.

vim shorties

I made up a list of vim commands I use , I wrote down the list but did not sort them out.

Also an Advanced Vim Tutorial can be found here written by smr , his homepage @T smr.co.in .

Also the list can be found @T http://students.iiit.ac.in/~sairam/tutorial/Vim.txt .

vim Shortcuts &| Small Codes
———————————————

h->left
j->down
k->up
l->right
k
h    l
j

Ctrl+N &| Ctrl+P for word Completion

:s/old/new/ for replacing in that line only,

:%s/old/new/g for replacing in the whole text.

:23,84s/old/new/ for replacing the text from lines 23 to 84.

:vsplit | :vs for vertical splitting,

:split for splitting horizontally,

:!cmd to execute a bash command.

Ctrl+G to show the file status.

Ctrl+[ for Escape mode.

i for insert mode.

I for insert mode, but changing the cursor to the start of the line.

R for Replace mode.

Ins for Insert/Replace Mode.

/searchword for searching from top to bottom

?searchword for searching from bottom to top

n for next match of the string

N for previous match of the string

/searchword\c for case-insensitivity.

:w to save

:q to quit

😡 == :wq = ZZ to save and quit.

:X for encrypting in vim and only vim can decrypt it.

$ -> End of line,

^ -> Start of line,

+ -> for going a line down,

– -> for going a line up.

G -> for going to the end of file,

gg -> for going to the start of file,

:23 | 23G -> goes to the 23rd Line,

yy -> yanking,

dd-> deleting,

p -> paste below the current line.

P-> paste above the current line,

J -> to join this line and the next line,

% @ } or { or ) or ( for finding their partner,

O -> insert a line above the present line,

0-> insert a line below the present line,

~ -> for changing the case of a letter.

cw-> delete from cursor position to end of word.

C-> Change to end of line.

cc -> delete from cursor position to the end of the line.

:a -> to apply a function|command to all its windows,

a -> start editing after the curr position of the cursor.

:r filename -> prints the file withe name filename at the curr cursor position.

u -> undo

Ctrl+R ->Redo

Ctrl+e to scroll down withe cursor position fixed until it is in view.

Ctrl+y to scroll up withe cursor position fixed until it is in view.

Ctrl+d to scroll down half a page

Ctrl+u to scroll up half a page.

Ctrl+f to scroll down a page,

Ctrl+B to scroll upwards a page,

V -> to select an area horizontally & vertically and apply some function on it.

Ctrl+V to select area vertically & horizontally and apply a function on it,

x-> delete charecter under cursor,

X-> delete charecter before cursor,

d$ -> delete till end of line,

5dw -> delete 5 words.

<no>command -> execute it <no> times,

Ctrl+w + Ctrl+w -> to shift between windows in splitted conditions,

Ctrl+w + Ctrl+r -> to reverse the positions of the windows,

Ctrl+w + Direction Key to go to that window.

Ctrl+w + Ctrl+q -> to quit that window.

* on a word searches for all occurances of that particular word.

Ctrl+y in a line to copy charecters from the above line.

H-> goto top of screen,

L -> goto bottom of screen,

rx-> replace charecter with x

A -> Start Inserting @T end of line.

:f filename -> change current file to filename

” vim: fdm=marker fdl=0 –> @T the end of a vim file applies these settings to that file. It folds with folding marker.