Find and grep commands for searching

Examples: Find files named core in or below the current directory find . -name core Find files starting with core […]

December 22nd, 2011

Posted In: linux

Custom permalink that contains post meta information

Here is the example how to improve custom post type permalink by adding additional information from the post meta in […]

October 28th, 2014

Posted In: wordpress

Simple logging for WordPress

Here is the example of simple function to log variables. Very basic. I like to copy paste this function: function […]

October 28th, 2014

Posted In: php, wordpress

Install Xdebug in Ubuntu

Should be very easy: 1. apt-get install php5-dev php-pear 2. pecl install xdebug 3. updatedb; locate xdebug.so 4. add to /etc/php5/apache2/php.ini this line […]

October 26th, 2014

Posted In: Debug, ubuntu

Blank screen fix for Ubuntu (Nvidia)

Some of these may work: Remove everything to do with the Nvidia proprietary drivers. sudo nvidia-settings –uninstall sudo apt-get remove […]

October 19th, 2014

Posted In: ubuntu

Uploading files to web server – idea

In some browsers, mostly in those based on WebKit, it is possible to drag and drop whole folders. Use that. […]

September 14th, 2014

Posted In: web server

Email and URL validators in PHP

public static function is_valid_url($url){ return preg_match('!^(http|https)://([\w-]+\.?)+[\w-]+(:\d+)?(/[\w- ./?~%&=+\']*)?$!', $url); } public static function is_valid_email($email){ return preg_match('/^(([a-zA-Z0-9_.\-+!#$&\'*+=?^`{|}~])+\@((([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+|localhost) *,? *)+$/', $email); } Thanks […]

August 31st, 2014

Posted In: php

Gravity Forms custom fields admin and preview pages

In Gravity Forms you need to have preview in Form Editor admin different then the normal form preview. You can […]

August 31st, 2014

Posted In: Plugins, wordpress

JQuery triggering events.

jQuery has super easy method for creating (issuing) events = trigger method. $(‘.el’).trigger(‘your_event_name’, [arg0, arg1, ..., argN]); You can handle […]

August 13th, 2014

Posted In: js

JavaScript get caller function

Sometimes we need to know the function that called other function in JavaScript. We can use arguments for that like […]

August 13th, 2014

Posted In: js

Printing JavaScript objects three ways

Found these useful: //method 1 console.log(obj); //method 2 var output = ”; for (var property in obj) { output += […]

August 9th, 2014

Posted In: js

Next Page »