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 code = '#' + $('#content-code').val(); | |
var target = $(code); | |
var timeInSeconds = $('#timeinseconds'); | |
var progress = $(code + ' .c100'); | |
vid.addEventListener('timeupdate', function() { | |
var seconds = vid.currentTime; | |
var duration = vid.duration; | |
var percentual = float2int((seconds/duration)*100); |
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 custom_woocommerce_payment_by_product($gateways){ | |
$products = array(3, 5); //id dos produtos | |
//Se existir o método de pagamento, e não tiver os produtos no carrinho, e remove o metodo de pagamento | |
if( isset( $gateways['pagseguro']) && !is_custom_has_product_cart($products)){ | |
unset( $gateways['pagseguro']); | |
} | |
return $gateways; | |
} |
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
/** | |
Element: Elemento Selecionado | |
Speed : Velocidade do Efeito | |
Increment: Valor que deseja incrementar na posição*/ | |
function goTo(element, speed, increment){ | |
var href = element.attr('href'); | |
var top = $(href).offset().top; | |
if(typeof increment !== 'undefined'){ | |
top += increment; | |
} |
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 | |
session_start(); | |
define("DIR", dirname(__FILE__)); | |
define("DS", DIRECTORY_SEPARATOR); | |
include_once DIR.DS.'App'.DS.'Loader.php'; | |
$loader = new App\Loader(); | |
$loader->register(); | |
try{ |
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
<!doctype html> | |
<html lang="pt-br"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Exemplo de flexbox + incremento de fonte com js</title> | |
<style type="text/css"> | |
.container{ | |
display:flex; | |
min-height:200px; | |
} |
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 getEmbed($value) | |
{ | |
$video = $value[1]; | |
$output = explode( '?v=', $video); | |
$player = '<iframe src="https://www.youtube.com/embed/%s"></iframe>'; | |
return sprintf($player, $output[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
<?php | |
class SimpleShortcode | |
{ | |
private $tags = []; | |
const regex = '/\[%s\](.*?)\[\/%s\]/'; | |
public function __construct($tags = []) | |
{ | |
$this->tags = $tags; |
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 | |
session_start(); | |
require_once "cart-functions.php"; | |
$itemsCart = getCartContent(); | |
$totalCart = getCartTotal(); | |
?> |
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 | |
session_start(); | |
define("DIR", dirname(__FILE__)); | |
define("DS", DIRECTORY_SEPARATOR); | |
include_once DIR.DS.'App'.DS.'Loader.php'; | |
$loader = new App\Loader(); | |
$loader->register(); |
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 ValidateForm = function(){ | |
var m = {}; | |
m.empty = function(field){ | |
}; | |
m.isset = function(field){ | |
}; |