Blog Spot!


Convert form data to JavaScript object with jQuery

serializeArray already does exactly that. You just need to massage the data into your required format:

$.fn.serializeObject = function()
{
    var o = {};
    var a = this.serializeArray();
    $.each(a, function() {
        if (o[this.name] !== undefined) {
            if (!o[this.name].push) {
                o[this.name] = [o[this.name]];
            }
            o[this.name].push(this.value || '');
        } else {
            o[this.name] = this.value || '';
        }
    });
    return o;
};

stackoverflow

Added on 09.Dec.2015
Tags: jquery js plugin json

Cross browser detection tab or window is active

// check if browser window has focus        
var notIE = (document.documentMode === undefined),
    isChromium = window.chrome;

if (notIE && !isChromium) {

    // checks for Firefox and other NON IE Chrome versions
    $(window).on("focus", function() { 
        // tween resume() code goes here
        setTimeout(function(){            
            console.log("focus");
        },300);

    }).on("blur", function() {
        // tween pause() code goes here
        console.log("blur");
    });

} else {

    // checks for IE and Chromium versions
    if (window.addEventListener) {

        // bind focus event
        window.addEventListener("focus", function(event) {
            // tween resume() code goes here
            setTimeout(function(){                 
                 console.log("focus");
            }, 300);
        }, false);

        // bind blur event
        window.addEventListener("blur", function(event) {
            // tween pause() code goes here
             console.log("blur");
        }, false);

    } else {

        // bind focus event
        window.attachEvent("focus", function(event) {
            // tween resume() code goes here
            setTimeout(function(){                 
                 console.log("focus");
            }, 300);
        });

        // bind focus event
        window.attachEvent("blur", function(event) {
            // tween pause() code goes here
            console.log("blur");
        });
    }
}

Added on 07.Dec.2015
Tags: focus blur active tab js javascript

How to disable apache2 server from auto starting upon boot up

Works in Ubuntu based systems.

You should disable them using either systemctl (if you're using systemd) or update-rc.d:

systemctl disable apache2 mysql

or

update-rc.d apache2 disable
update-rc.d mysql disable

stackexchange

Warning! This will REMOVE the service!

sudo update-rc.d -f  apache2 remove
sudo update-rc.d -f  mysql remove

askubuntu

Added on 02.Dec.2015
Tags: apache2 mysql disable boot startup autostart

5 Beautiful Icon Themes for Linux

One of my favorite things about Linux is customization. There are many ways to customize it, and the most interesting of them all is the icons. Though they don’t change your entire interface, they can change the way you see your desktop. Icons make you feel at home, and no theme feels quite as complete without them.

How to install icon themes

Icon themes can be installed in two ways. You can install your icons to the system directory, effectively making your icon theme accessible to every user on the system. Alternatively, it’s possible to just enable it for one user only.

Download an icon theme of your choice and extract the files inside the archive. For instance, if you’ve chosen to download Dalisha (see the link below), you’d be extracting “Dalisha_2_2.tar.gz”. Once extracted, a folder will appear (in this case it’s called Dalisha). Open a terminal window and enter the command(s) below to install the icon themes.

Installing systemwide

sudo mv /path/to/icon/theme/folder/ /usr/share/icons/ -r

Installing for one user

mv /path/to/icon/theme/folder/ ~/.icons -r
  • Remember to change the filepath to where you have extracted the icon theme archive.

Once the theme has been installed, enable the icon theme inside your desktop environment with the DE’s own configuration tool. Or, using your tool of choice. If you are not sure what tool to use, check out Gnome Tweak Tool (it works with most GTK desktops). If you’re on KDE, just open the KDE application menu and search icons. It should be pretty straight-forward.

Now, check out some of the beautiful icon themes below.

5-beautiful-icon-themes-for-linux

Extra:

Added on 01.Dec.2015
Tags: linux icons

5 Great GTK Themes for Linux

How to install GTK Themes

There are two different ways to install GTK themes. You can install the theme to the root theme directory which will make your new theme available to all users on the system. Alternatively, it’s possible to just install the theme to your home directory for your own use.

For example: If you wanted to install the Iris Dark theme, you’d go to the download page and get the theme’s .zip file. Once you have it downloaded, extract it, move the folder to your home directory and open a terminal window.

Installing GTK theme system wide

sudo mv ~/gtk-theme-folder/ /usr/share/themes/ -r

Installing GTK theme for one user

mv ~/gtk-theme-folder/ ~/.themes -r

Note: The .themes folder is hidden by default. If it does not exist, create it.

Once your theme is installed, you can go to the System Settings to change the theme.

GTK Themes

Are you picky when it comes to GTK themes? Are you interested in a more modern style theme? Here’s a collection of some of the best designed, sleek and modern GTK themes on the Internet.

gtk-themes-for-linux

Added on 01.Dec.2015
Tags: linux gtk themes

Search


PHP Libraries


Carbon lib / docs
Idiorm lib / docs
Image Workshop lib / docs
lorenzos/Minixed lib / docs
Parsedown lib / docs
PHP Paginator lib / docs
PHP Redis lib / docs
QrCode lib / docs
Requests lib / docs
Slim lib / docs
Spyc lib / docs
TWIG lib / docs
Upload lib / docs
Validation lib / docs
Zebra Image lib / docs

JS Libraries


AJV lib / docs
BackboneJS lib / docs
Bootstrap Notify lib / docs
C3.js lib / docs
ChartJS lib / docs
FastMD5 lib / docs
HighlightJS lib / docs
jQuery-Storage lib / docs
JS-Cookie lib / docs
Leaflet JS lib / docs
LowDB lib / docs
Marked lib / docs
NeedlyJS lib / docs
ParcelJS lib / docs
RequireJS lib / docs
Swig lib / docs
Toastr lib / docs
Underscore lib / docs
ValidateJS lib / docs
top