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 | |
$toName = 'Emerson Carvalho'; | |
$toEmail = 'abc@abc.com.br'; | |
$name = ''; | |
$email = ''; | |
$phone = ''; | |
$subject = ''; |
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
var URL = window.location.protocol + '//'+ window.location.host; | |
$(document).ready(function(){ | |
$('#contact').validate({ | |
rules:{ | |
name:{ | |
required: true, | |
minlength: 3 | |
}, |
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
/* | |
* Wp Update URL | |
* Based on http://www.onextrapixel.com/2010/01/30/13-useful-wordpress-sql-queries-you-wish-you-knew-earlier/ | |
* Change the url on the database. | |
* @author Emerson Carvalho (@emersonbroga) | |
* | |
* @param $oldUrl STRING REQUIRED ex: http://www.site.com.br | |
* @param $newUrl STRING OPCIONAL ex: http://www.newsite.com | |
* | |
*/ |
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 app_api() | |
{ | |
$return = array('status' => 'error', 'status_msg' => 'Operation Error'); | |
$params = $_GET; | |
unset($params['action']); | |
$result = get_posts($params); | |
if($result){ | |
$return['status'] = 'ok'; |
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 | |
/** | |
* Amazon Simple Email Service (SES) connection object | |
* | |
* Integration between Zend Framework and Amazon Simple Email Service | |
* | |
* @category Zend | |
* @package Zend_Mail | |
* @subpackage Transport |
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
echo '<pre style="background-color: #FFF; color:#000">'; | |
$s3Key = ''; | |
$s3Sectret = ''; | |
$imagePath = UPLOAD_PATH. DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR; | |
$fileName = 'barcode_2012090000110.jpg'; | |
$bucketName = $_SERVER['HTTP_HOST']; | |
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 getYoutubeVideos( $username, $limit = null) | |
{ | |
$url = 'http://gdata.youtube.com/feeds/api/users/'.$username.'/uploads'; | |
$feed = simplexml_load_file($url); | |
$videos = array(); | |
$limit = ($limit === null ) ? count($feed->entry) : $limit; | |
$i = 0; |
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 getFacebookCurrentUserId( $secret = null ) | |
{ | |
$data = getFacebookCurrentUser($secret); | |
return (isset($data['user_id'])) ? $data['user_id'] : null; | |
} | |
function getFacebookCurrentUser( $secret = null ) | |
{ |
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
class Cep | |
{ | |
private $url = 'http://www.republicavirtual.com.br/web_cep.php?'; | |
private $cep, $formato, $consulta; | |
public $uf, $cidade, $bairro, $tipo_logradouro, $logradouro, $header; | |
public $resultado; | |
public function __construct($cep, $formato='query_string') | |
{ | |
$this->cep = preg_replace('([^0-9])', '', $cep); |
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 | |
/* | |
* File: SimpleImage.php | |
* Author: Simon Jarvis | |
* Copyright: 2006 Simon Jarvis | |
* Date: 08/11/06 | |
* Link: http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php | |
* | |
* This program is free software; you can redistribute it and/or |