Visar inlägg med etikett tips. Visa alla inlägg
Visar inlägg med etikett tips. Visa alla inlägg

torsdag 29 september 2011

Tips #2 Add javascript: click() prototype to HTMLElement's for Firefox etc.

If you want to use the click() method on a HTML element on a webbrowser other than Microsoft's Internet Explorer you can add this code at the start somewhere of your code.

if(typeof HTMLElement!='undefined'&&!HTMLElement.prototype.click)
    HTMLElement.prototype.click=function(){
        var evt = this.ownerDocument.createEvent('MouseEvents');
        evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
        this.dispatchEvent(evt);
    }


//QubeX2

onsdag 28 september 2011

Tips #1 Batch resize images with Bash

find ./ -iname "*.jp*" -exec /-mogrify -resize 800 {} \;

The argument -iname makes find match case insensitive.
The argument -exec continues until it finds a backslash escaped ; eg. "\;".

Good luck
/QubeX2