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
[ | |
{ | |
"prato": "Escondidinho de frango e mandioquinha / arroz branco", | |
"preco": 21 | |
}, | |
{ | |
"prato": "Carne cozida ao molho de cerveja / arroz sete grãos", | |
"preco": 21 | |
}, | |
{ |
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
/* Ajuste de altura googlemaps */ | |
var $contato = $('.contato'); | |
var $onde = $contato.find('.onde'); | |
var $entre = $contato.find('.entre'); | |
function ajustarAlturaMapa() { | |
$onde.height($entre.height()); | |
} | |
ajustarAlturaMapa(); |
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
{ | |
"order": | |
{ | |
"client": { | |
"name": "Thiago", | |
"phone": "3454534", | |
"email": "[email protected]", | |
"shipping": {"id": 1} | |
}, | |
"orderItens": |
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 | |
/** | |
* Return value in R$ | |
* | |
* @param float $value | |
* @return string | |
*/ | |
function reais($value) | |
{ | |
return number_format($value, 2, ',', '.'); |
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 | |
/** | |
* Method addParcel() | |
* | |
* Allows to add a order to parceling. | |
* | |
* @param int $min The minimum number of parcels. | |
* @param int $max The maximum number of parcels. | |
* @param float $rate The percentual value of rates | |
* @param boolean $transfer "true" defines the amount of interest charged by MoIP installment to be paid by the payer |
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
<EnviarInstrucao> | |
<InstrucaoUnica> | |
<Razao>Carrinho de compras Loja Modelo</Razao> | |
<IdProprio>compra1234</IdProprio> | |
<FormasPagamento> | |
<FormaPagamento>BoletoBancario</FormaPagamento> | |
<FormaPagamento>CarteiraMoIP</FormaPagamento> | |
<FormaPagamento>CartaoCredito</FormaPagamento> | |
<FormaPagamento>DebitoBancario</FormaPagamento> | |
<FormaPagamento>FinanciamentoBancario</FormaPagamento> |
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 validate_cpf = function(value) { | |
var cpf = value.replace('-', '').replace('.', ''); | |
while(cpf.length < 11) cpf = "0"+ cpf; | |
var expReg = /^0+$|^1+$|^2+$|^3+$|^4+$|^5+$|^6+$|^7+$|^8+$|^9+$/, | |
a = [], b = new Number, c = 11; | |
for (i=0; i<11; i++) { | |
a[i] = cpf.charAt(i); |
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 | |
private function priceTable($taxa, $quantParcelas, $valor) | |
{ | |
$valor1 = $taxa * pow((1 + $taxa), $quantParcelas); | |
$valor2 = pow((1 + $taxa), $quantParcelas) - 1; | |
$pgto = $valor * ($valor1 / $valor2); | |
return $pgto; | |
} |
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 | |
// COMPRA REALIZADA | |
Event::listen('pedido.status.realizado', function($id) | |
{ | |
Mailer::sendStatus($id, 'Pedido Realizado'); | |
}); | |
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 best(fun, coll) { | |
return _.reduce(coll, function(x, y) { | |
return fun(x, y) ? x : y | |
}); | |
} | |
best(function(x,y) { | |
return x > y | |
}, [1,2,3,4,5]); | |
// 5 |