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

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

JavaScript function closure

In JavaScript you see the function reside in another function. Well, the inner function has access to variables in the […]

August 9th, 2014

Posted In: js

JavaScript protopype

In Java, you start by creating a classes for your objects and then you can create new objects. In JavaScript […]

August 9th, 2014

Posted In: js

Measure PHP code execution time

$time_start = microtime(true); //some PHP code $time_end = microtime(true); echo $execution_time = ($time_end – $time_start); Thanks

July 30th, 2014

Posted In: php, Tips and tricks

WordPress requests

This will be some logical covering of the WordPress request – the initiation of the web request in WordPress that […]

July 14th, 2014

Posted In: wordpress

WordPress filters grouping

Provided the list of WordPress filters in here, created some time ago. In fact the list is not grouped. How […]

July 14th, 2014

Posted In: wordpress

Next Page »