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 isInViewport(el) { | |
const rect = el.getBoundingClientRect(); | |
return ( | |
rect.top >= 0 && | |
rect.left >= 0 && | |
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && | |
rect.right <= (window.innerWidth || document.documentElement.clientWidth) | |
); | |
} |
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 | |
/** | |
* Display CPT on Recent Post widget | |
* @author Maxwell | |
* @version 0.0.1 | |
*/ | |
add_filter( 'widget_posts_args', 'jps_news_widget_recent_post' ); | |
function jps_news_widget_recent_post( $params ) |
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
if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) | |
{ | |
$mbEncoding = mb_internal_encoding(); | |
mb_internal_encoding('ASCII'); | |
} | |
// Create your message and send it with Swift Mailer | |
if (isset($mbEncoding)) | |
{ |
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
<form action="somefile.php" method="post" > | |
<!-- Recaptcha --> | |
<script type="text/javascript" | |
src="http://www.google.com/recaptcha/api/challenge?k=public_key"> | |
</script> | |
<noscript> | |
<iframe src="http://www.google.com/recaptcha/api/noscript?k=your_public_key" | |
height="300" width="500" frameborder="0"></iframe><br> | |
<textarea name="recaptcha_challenge_field" rows="3" cols="40"> |
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 | |
class App_Form_Common_Validate_Recaptcha extends Zend_Validate_Abstract | |
{ | |
const INVALID_VALUE = 'invalidValue'; | |
protected $_messageTemplates = array( | |
self::INVALID_VALUE => "'%value%' is not valid"); | |
public function isValid($value) | |
{ |
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 | |
/** | |
* Uses smarty template engine to render html pages | |
* @author shawndreck | |
* | |
*/ | |
require_once APPLICATION_PATH . '/../lib/Smarty/SmartyBC.class.php'; | |
class ZendExt_View_Smarty3 implements Zend_View_Interface | |
{ |
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 | |
/** | |
* Smarty plugin | |
* | |
* @package Smarty | |
* @subpackage PluginsModifier | |
*/ | |
/** | |
* Smarty gravatar_hash modifier plugin |
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
<?xml version="1.0" encoding="utf-8"?> | |
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" | |
xmlns:s="library://ns.adobe.com/flex/spark" | |
xmlns:mx="library://ns.adobe.com/flex/mx"> | |
<fx:Script> | |
<![CDATA[ | |
import mx.controls.Alert; | |
protected function verifyURL(sUrl:String):String{ | |
if(sUrl.substring(0,"http".length) == "http"){ | |
return sUrl; |
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
#include<stdio.h> | |
#include<math.h> | |
/* | |
* To compile use the following, use the command:" gcc -o my_pi pi.c -lm" | |
* Assuming you are using gcc compiler and the file name is pi.c | |
*/ | |
double calc1(int num1) | |
{ | |
return (16/(num1 * pow(5.0,num1 * 1.0))); | |
} |