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
// http://pastie.org/783420. | |
// view the full video at: | |
// http://jquery14.com/day-05/jquery-1-4-hawtness-1-with-paul-irish | |
/* d8b .d88888b. d888 d8888 | |
Y8P d88P" "Y88b d8888 d8P888 | |
888 888 888 d8P 888 | |
8888 888 888 888 888 .d88b. 888d888 888 888 888 d8P 888 | |
"888 888 888 888 888 d8P Y8b 888P" 888 888 888 d88 888 | |
888 888 Y8b 888 888 888 88888888 888 888 888 888 8888888888 |
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
while (list($n,$v) = each($_POST)) { | |
$$n=$v; | |
} |
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 filter_post($post, $columns){ | |
return array_intersect_key($post, array_flip($columns)); | |
} |
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 ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
function myInArray($array, $value, $key){ | |
//loop through the array | |
foreach ($array as $val) { | |
//if $val is an array cal myInArray again with $val as array input | |
if(is_array($val)){ | |
if(myInArray($val,$value,$key)) | |
return true; | |
} |
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
$.fn.slideBox = function(){ | |
var blockIt=function(a){if(!a.hasClass("blocked"))return a.addClass("blocked"),!0} | |
this.each(function(){ | |
var a = $(this); | |
//prevent double binding | |
if (blockIt(a)) { | |
var obj = a.children(); | |
var content_size = {width: obj.width(), height: obj.height()} | |
var total_size_minus_visible_area = {width: content_size.width - a.width(), height: content_size.height - a.height()}; | |
var wrapperSize = {width:content_size.width + total_size_minus_visible_area.width, height: content_size.height + total_size_minus_visible_area.height}; |
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
$.fn.enapupeSlider = function(changeDelay, transitionDelay, startDelay, halt_opt) { | |
var blockIt = function (a){ | |
if (!a.hasClass("blocked")) | |
return a.addClass("blocked"),!0 | |
} | |
this.each(function(inc, el){ | |
if (blockIt($(el))) { | |
//shows master slideshow div onstart | |
$(el).css("visibility", "visible"); |
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 | |
namespace Obiz\Challenges\CashMachine; | |
class WithdrawException extends \Exception { | |
} | |
class CashMachine { |
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 s1mp_cep($cep) { | |
try { | |
$get = file_get_contents("http://cep.s1mp.net/" . $cep); | |
} catch (Exception $e) { | |
return false; | |
} | |
if ($json = json_decode($get)) { | |
if ($json->result === true) { | |
return array('cidade' => $json->data->cidade, 'uf' => $json->data->uf, 'logradouro' => $json->data->logradouro, 'bairro' => $json->data->bairro, 'tp_logradouro' => $json->data->tp_logradouro);>tp_logradouro); | |
} |
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
//drop utm | |
if(/utm_/.test(location.search)&&window.history.replaceState){var oldUrl=location.href,newUrl=oldUrl.replace(/\?([^#]*)/,function(b,a){return(a=a.split("&").map(function(a){return!/^utm_/.test(a)&&a}).filter(Boolean).join("&"))?"?"+a:""});newUrl!=oldUrl&&window.history.replaceState({},"",newUrl)}; | |
(function($){ | |
})(jQuery); |
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 | |
//error_reporting(0); | |
$validation = array( | |
'email' => 'Digite um e-mail!', | |
'nome' => "Digite seu nome!" | |
); | |
foreach($validation as $key => $message){ | |
if (empty($_POST[$key])){ | |
echo json_encode(array('message' => $message, 'status' => 'fail')); | |
exit; |