This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function urlParam(name, w){ | |
w = w || window; | |
var rx = new RegExp('[\&|\?]'+name+'=([^\&\#]+)'); | |
var val = w.document.URL.match(rx); | |
return !val ? '':val[1]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* function validateEmail(email){} | |
* @author Anunay Dahal | |
* @param String email [Email address as a parameter] | |
* @return Boolean [Returns TRUE if email address is valid else return FALSE] | |
*/ | |
function validateEmail(email){ | |
return /^([\w!.%+\-])+@([\w\-])+(?:\.[\w\-]+)+$/.test(email); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type='text/javascript'> | |
jwplayer("PLAYER_ID").setup({ | |
flashplayer: "/jwplayer/player.swf", | |
controlbar: "bottom", | |
dock:false, | |
file: "AUDIO/VIDEO FILENAME", | |
streamer: "rtmp://STREAMING-DISTRIBUTION-DOMAIN-NAME/cfx/st", | |
width: "162", | |
height: "24", | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! function_exists('product_post_type') ) { | |
// Register Custom Post Type | |
function product_post_type() { | |
$labels = array( | |
'name' => _x( 'Products', 'Post Type General Name', 'text_domain' ), | |
'singular_name' => _x( 'Product', 'Post Type Singular Name', 'text_domain' ), | |
'menu_name' => __( 'Product', 'text_domain' ), | |
'parent_item_colon' => __( 'Parent Product:', 'text_domain' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* The "streamer/file" setup you are using is used by | |
* an older version of JW Player (JW5), but not by the | |
* latest version (JW6). We're still going back and forth | |
* with Cloudfront to update their docs... | |
* | |
* Anyway, setting the RTMP stream with just a single "file" | |
* will work for JW6: | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##Whitelist IP in ModSecurity | |
#1. If you need to whitelist an IP in ModSecurity (v2.7+), here’s what to do: | |
nano /usr/local/apache/conf/modsec2/whitelist.conf | |
#2. add this line, replacing (#####) with a unique ID number for mod security, I used a version of my whitelisted ip address: | |
SecRule REMOTE_ADDR "@ipMatch 1.2.3.4" "phase:1,t:none,nolog,allow,ctl:ruleEngine=Off,ctl:auditEngine=Off,id:(#####)" | |
#3. Then restart apache. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*Optional Paramter SKIPTO to redirect to some other upsell page */ | |
if(isset($_REQUEST['skip']) && @$_REQUEST['skip'] == "true" ){ | |
header("Location: " . $skipto); | |
exit; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function to_slug($string){ | |
return strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $string))); | |
} | |
// Input: This is Headline | |
// Returns: this-is-headline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$string = preg_replace("/[^a-z0-9]+/i", "", $string); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Supports normal, ftp, file and email URL’s as well as subdomains. | |
* Also it doesn’t mess with HTML a tags that already exist in the string. | |
* | |
* @param String $text Contens that needs to be parsed through | |
* @return String String | |
* | |
*/ |
OlderNewer