Javascript closures

Closures in JavaScript zijn functies met 'vrije variabelen'. De functie onthoud zijn omgeving waarin hij gemaakt is. Je kunt een closure gebruiken om dynamische functies te maken. Wat voorbeelden zullen helpen om het geheel te begrijpen. In onderstaand voorbeeld maken...
Read More

Javascript prototype

Definitie: Een prototype is een object waarvan geïnstantieerde objecten de properties erven. (bron: JavaScriptWeblog) Als je, bijvoorbeeld, een functie 'car' maakt (wat dan een object is, aangezien alle functies in javascript objecten zijn) en je plaatst properties en...
Read More

Set permissions on files equal to another directory in linux

In this example, I want to make the owners and permissions of files in the current directory equal to the same file in another directory. This is the scenario: I am in /tmp/dir1 I want to set the permissions and owners on every file in the current directory to be...
Read More

PHPStorm - connect to MySQL database

It can be a bit painful to get the database connection started from your PHPStorm IDE to your MySQL database. As a quick hint, this is where it went wrong with mine: MySQL wasn't listening for incoming connections on the network (change directive bind-address to...
Read More

Install PHP Code Sniffer (phpcs)

PHP CodeSniffer, aka phpcs, helps you in detecting violations in your PHP code. Violations can be: opening curly brackets in the wrong place (on a new line, or vice versa) indentation use of upper- or lowercase variable/function/method/class names missing phpdoc...
Read More

PHPStorm - use PHP CodeSniffer

Use PHP Code Sniffer to detect violations to coding standards in your PHP files. To use PHP Code Sniffer in PHPStorm, open the Settings and go to PHP -> Code Sniffer In the field 'PHP Code Sniffer (phpcs) path:' fill in the path where the binary resides. Most of...
Read More

Use PHP CodeSniffer with PHPStorm

PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards. [crayon-59541794e6eeb311580494/] That's it! You can play with it now. For example: use PHP CodeSniffer with PHPStorm  
Read More

Install PHP Mess Detector (phpmd)

What is PHP Mess Detector? Given its homepage, it aims to detect: Possible bugs Suboptimal code Overcomplicated expressions Unused parameters, methods, properties In short: it helps by pointing you on the mess inside your PHP scripts! Listing available packages:...
Read More

install pear on OSX Mountain Lion

Install PEAR on your OSX Mountain Lion machine to easily install PHP libraries. [crayon-59541794e78dd596409797/] Install pear. Accept the defaults while installing. [crayon-59541794e78e9417147908/] Pear is installed! [crayon-59541794e78f0194750069/] Now you can...
Read More

setup xdebug in PHPStorm

Install xdebug on the server Installing Xdebug on the server is not in the scope of this article. You can find related articles here: http://xdebug.org/docs/install http://www.jetbrains.com/phpstorm/webhelp/... Install xdebug on Ubuntu: http://ubuntuforums.org/.......
Read More