If you use WYSIWYG module in a drupal and notice that "Show enable/disable rich text toggle link doesnt work", here is the patch which will make it work.
Or you can edit the wysiwyg.js file and add an if condition to solve this.
if (Drupal.settings['wysiwyg']['showToggle']) {
Drupal.wysiwygAttachToggleLink(context, params);
}
instead of
Drupal.wysiwygAttachToggleLink(context, params);
Please let me know if it doesnt works for you.
Wednesday, March 18, 2009
Tuesday, March 17, 2009
Do you use reusable code ?
I came across one of the site (TechRepublic) which had a poll,
I answered the second one, "Yes, all of the time", which I thought would be most successful one. But it gave me a strange results, which made me feel bad that am i not doing the right way of coding ? or others are not following as just they are careless... ?
anyway.. I still will be reusing the code, whatever it might happen, which makes me feel better.
Do you use reusable code?
- Yes, occasionally (52%)
- Yes, all of the time (28%)
- No. Even though I write reusable code, it never gets reused. (15%)
- No. Why bother writing reusable code? (5%)
Total Votes: 317
I answered the second one, "Yes, all of the time", which I thought would be most successful one. But it gave me a strange results, which made me feel bad that am i not doing the right way of coding ? or others are not following as just they are careless... ?
anyway.. I still will be reusing the code, whatever it might happen, which makes me feel better.
Saturday, March 14, 2009
convert all windows format files to unix format
Convert all files to Unix Format from DOS/WindowsGuys, if you use Windows for coding and Linux or (*nix, Mac, SunOS, etc.,) then some times the files which you have saved in the Windows will not work in the *nix versions.Also you might be using SVN for your repository and committing the files thru Windows machine.Do you know why the files which have saved in the Windows doesn't works in the Linux flavored versions ? Okay, Okay, let me tell you its because Windows saves all the lines with a different ending character which Linux flavored versions doesn't understands it.So here is the command to find all the files in a particular directory and its recursive too, excluding the SVN folders and change the files to unix format files.find . -type f \! -path "*svn*" -exec dos2unix {} \;Hope this would help you to do the functionality easily.
Friday, March 13, 2009
use sed to fetch a part of the file.
Suppose say you have a very huge file which might be in GB(s) and you want only a part of the file to be seen then vi is not suitable to view that file. Instead use a sed which does this job very easily.
sed -n -e 'Start_line_number,End_line_number p' Filename
This will retrieve only those lines staring from "Start_line_number" and upto including "End_line_number"
This is best useful command to retrieve only a part of file which is very huge and big.
sed -n -e 'Start_line_number,End_line_number p' Filename
This will retrieve only those lines staring from "Start_line_number" and upto including "End_line_number"
This is best useful command to retrieve only a part of file which is very huge and big.
Thursday, March 12, 2009
deleting all the mails when logging in the console mode
Do you need to delete all the mails which shows when you log in to the console. Console in the sense it might be ubuntu, mac, or any linux flavours. You might get something like this..
Last login: Fri Mar 13 10:20:10 on ttys001
You have mail.
And you want to get rid of all the mails right ?
The easy and the simplest way to get rid of all the mails is
echo 'd *' | mail -N
This will delete all the mails present for the current user.
Last login: Fri Mar 13 10:20:10 on ttys001
You have mail.
And you want to get rid of all the mails right ?
The easy and the simplest way to get rid of all the mails is
echo 'd *' | mail -N
This will delete all the mails present for the current user.
Subscribe to:
Posts (Atom)