Wednesday, May 25, 2011

MODx Revo TinyMCE font color, table button

Default MODx Revolution TinyMCE doesnt contain font colour or table button.
To add font color, go to system : system setting
search for filter: "tiny"
add "forecolor" into tiny.custom_buttons# key.
add "table" into tiny.custom_buttons# key.

then add "table" into tiny.custom_plugins

This shall do a quick fix to have the things you need.
But do look for tiny.css_selectors to do a proper font face and size via classes.

For other buttons and plugins:

Monday, May 23, 2011

dhtmlx combo forceselection

Hi found a way to hack on dhtmlx combo to allow forceselection.
just add this code after dhtmlxcombo.js

dhtmlXCombo.prototype._confirmSelection = function(data,status){
var z=this.getOptionByLabel(this.DOMelem_input.value);
//data = z?z.value:this.DOMelem_input.value;
data = z?z.value:null;
status = (z==null);
if (data==this.getActualValue()) return;
this.DOMelem_hidden_input2.value = (status?"true":"false");

Sunday, May 22, 2011

jQuery idTabs switching tab

idTabs contains a bug where you may not program it to switch tab by passing


This is due to the if statement in idTabs function which collect the "selected" class in a tag to determine the active tab.

the fixed version is available here:

Friday, May 20, 2011

HTML5 framework

52 Framework is pretty much a all in one packed framework for any html5 start off.
It contains grid with columns CSS, CSS 3 , HTML5, Form CSS, Form Validation and CSS reset.
It also include modernizer to fix up some issue with IE.

For those whom need IE canvas on IE 8 or below:

Sunday, May 8, 2011

div offsetWidth 0?

Did you ever encounter offsetWidth returning 0?
In my case, it happen when ive a div within a div where it represent a container for a jquery tab.
Somehow, i found out that the offsetWidth return 0 if i did not tab to that tab.
Once ive tab into that tab, the offsetWidth now return the actual width rendered.
Took me some hours to solve this issue...

Thursday, May 5, 2011

Netbean 7 is out

Hmm i know, im kinda outdated.
Recently, due to some problem with netbean, ive decided to check out the latest version.
To my surprise, i was outdated , lol.
My first try on netbean 7 was wonderful :)
Now, the project scanning is less of a nuisance , and lighter processing weight.
I could do my work while the project scanning doing its job, unlike netbean 6.9...

And also, great improvement on the version control ui. The new version has git in the plugin repository. It seems like this version control is much faster :).
I still remember, preferring to run git command from console due to the netbean slow scanning speed for version control. But still, console command git is still much faster.

vps ssh not starting after update in openvz

if you face this condition, you are almost doomed for reinstall, but wait!

edit /vz/private/[vbox#]/etc/init/ssh.conf,
comment off oom never:
#oom never

reboot the vps, it shall work :)
or else, try alternative below:

there is a way to solve this..
1st, create a file in /etc/init.d/sshstart

fill it up with:
sh /etc/init.d/ssh start

then run
/sbin/vzctl runscript [vps container #] /vz/private/[vpscontainer#]/etc/init.d/sshstart

if you get any error, this might give you lead on how to solve it.

but as for my condition, i found the problem in the /var/log/daemon.log to refer to:
init: ssh main process (21717) terminated with status 255
Failed to spawn ssh pre-start process: unable to set oom adjustment: Operation not permitted

Someone suggested that the issue is because the ssh is not launched after network, therefore to fix it, you will need to edit /etc/ssh/sshd_config and enable the line ListenAddress

But in my case, it didnt work. so ive done a work around to start it via vzctl.
If you dont know your vps container #, its in
ls /vz/private/


openvz stop running

Sometimes, updating the o/s of the dedicated server with openvz installed, might trigger change of default kernel to boot from.
To fix it...
sudo vi /boot/grub/menu.lst

Change the line to point to the index of the openvz kernel. the starting index will be 0
default 1
default 0

Userful command:
/usr/sbin/vzlist -a
uname -a

Wednesday, May 4, 2011

openvz meta data checksum failed

If you face checksum failed when trying to sudo yum update, try this:

sudo yum clean all
sudo yum makecache

Tuesday, May 3, 2011

baseurl for ie7 or ie6

BASEURL can be used to set the root path for all image, links and javascript src path within the page.
But IE 7 or below seems to have problem if we use baseurl to "/".
Instead, use full url: example:

But in IE 8 or above, or chrome 11 or firefox 4, its okay.