Baysao's note

Sunday, May 11, 2008

Add subscription to google reader

I wrote a macro to get a link to add feed to Google Reader or Google Homepage.
I tested it in Kmeleon 1.5beta. I think it would be work on old version.
I share it here for you guys who are interested.
Link here

Macro popup google application

In Firefox, there is sidebar that could use to display useful information. I was hearing in there, people using Google applications(Google Notebook,Gtalk,GReader,GMail,GDocument,GCalendar...) which has built for mobile application to display in sidebar. In K-Meleon, in this moment sidebar isn't, i think about using javascripts to popup small windows to view page contents. That is very similar sidebar in firefox. Very usefuls.
Here is my macro GApplication.kmm . Hoping useful for you guys.
Use: To use this macro, you have to turn off function Popup blocker or add exceptions rule to popup except www.google.com address.
Download here

Macro open selected text as URL in new tab

# Macro name: OpenAsURLInNew.kmm
# Author: Thanh Vu(baysao@gmail.com)
# Macro help open selected text in new tab
# Macro depend macro main.kmm

Open_TextAsURLInNew{
$OpenURL=$SelectedText; $OpenURL==""?0:opentab($OpenURL);
}

# - PRIVATE
_OpenAsURLInNew_BuildMenu{
setmenu(Selection,macro,"Open As URL in &New",Open_TextAsURLInNew);
}

$OnInit=$OnInit."_OpenAsURLInNew_BuildMenu;";

Macro open new post in blogger

# Macro name: blogger.kmm
# Author: Thanh Vu(baysao@gmail.com)
# Macro help quick open new post in blogger
# Macro depend macro Gapplication.kmm

$_blogger_conf="kmeleon.general.bloggerID";
Blogger{
$__userid=getpref(STRING, $_blogger_conf);
$__userid=="" ? &Blogger_set : "";
$__userid=="" ? "" : &Blogger_run;
}

Blogger_run{
$OpenURL="http://www.blogger.com/post-create.g?blogID=".$__userid;
&OpenURL_InNew;
}

Blogger_set{
$__userid=prompt("Set your blog ID: ", "Blogger setup");
$__userid=="" ? "" : setpref(STRING, $_blogger_conf, $__userid);
}

_Blogger_BuildMenu{
setmenu($Gpopup_menu,macro,"Set &ID Blogger",Blogger_set);
setmenu($Gpopup_menu,macro,"Google &Blogger",Blogger);
}

_Blogger_BuildAccel{
setaccel("CTRL ALT B","macros(Blogger)");
}
$OnInit=$OnInit."_Blogger_BuildMenu;_Blogger_BuildAccel;";

# ------------------------------------------------------------------------------------------------------------------
$macroModules=$macroModules."blogger;";

Friday, May 9, 2008

Remove google and yahoo ads

(From keyvan blog)
Using 1 of 4 method below

1. AdBlock Plus extension

Install Adblock Plus and add the following two filters:

http://ypn-js.overture.com/*

and

http://pagead2.googlesyndication.com/*

2. CSS solution—no additional addons required

Edit userContent.css (use ChromEdit Plus or read Editing Configuration Files if you need help) and add the following two rules:

/*
* Remove Google ads
*/
iframe[name='google_ads_frame'],
a[href^='http://pagead2.googlesyndication.com']
{ display: none ! important; }

/*
* Remove Yahoo ads
*/
iframe[src^='http://ypn-js.overture.com']
{ display: none ! important; }

3. Replacing Ads with Greasemonkey

Install Greasemonkey and then my Replace Google/Yahoo Ads script.

4. Windows hosts

Add theses line in C:\WINDOWS\system32\drivers\etc\hosts

127.0.0.1    pagead2.googlesyndication.com
127.0.0.1 ypn-js.overture.com

Wednesday, May 7, 2008

pratika java

java.lang.IllegalStateException: Attempt to mutate in notification
resolved :

EventQueue.invokeLater(
new Runnable()
{
public void run() {
}});