Skip to content

Instantly share code, notes, and snippets.

View marcaum54's full-sized avatar

Marcos Fábio dos Santos Amaral Júnior marcaum54

View GitHub Profile
<?php
//72F82C4B0CBCC1704CDD2130E685E767
class Dota2_API
{
protected $_apiKey;
const HEROES_NAME_PREFIX = 'npc_dota_hero_';
const URL_GETHEROES = 'https://api.steampowered.com/IEconDOTA2_570/GetHeroes/v0001/';
@marcaum54
marcaum54 / gist:6716659
Created September 26, 2013 16:30
Esse foi o resultado me retornado passando os seguintes parametros: $Tipo = 'P' $SiteId = 35
Array
(
[0] => stdClass Object
(
[Tipo] => P
[Id] => 1535
[Nome] => Exame de Ordem - Administrativo Completo
[Valor] => 389,00
[Objetivo] => <p>&lt;p&gt;a&lt;/p&gt;</p>
[Temas] => <p>&lt;p&gt;a&lt;/p&gt;</p>
<?php
$pathCsv = __DIR__ . '/arquivos/';
$arquivos = array(
'contas1.csv',
'contas2.csv'
);
$rows = array();
<?php
try
{
$x = new SoapClient((string)$this->url);
}
catch (SoapFault $e)
{
$this->setMessage('Servidor Indisponivel. Por favor, entre em contato com nosso setor financeiro.');
$this->setRedirect('index.php?option=com_ag&view=login');
@marcaum54
marcaum54 / fortes_meeting
Last active August 29, 2015 14:01
HTML do Email Marketing
<html>
<head><title></title></head>
<body style="background-color: #FFF;">
<table style="margin: 0 auto; width: 600px; border:0; border-collapse: collapse;" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td><img src="http://fortesinformatica.com.br/v3/i/newsletters/2014/fortes_meeting/bg-01.png" /></td>
</tr>
<tr>
<td align="center" valign="middle" style="height: 80px;">
ERROR | NASH - Contas a Receber - Dados: Informação fornecida pelo NASH - Status: '3' | Erros: Array
(
[0] =>
)
Contas a Receber: ContaAReceber Object
(
[Empresa] =>
[Cliente] => Cliente Object
(
protected function get400() {
$content = $this->getHttpObject()->getContent();
$erros = json_decode($content, true);
$erro = array();
if (is_array($erros)) {
if (key_exists("Erros", $erros) && is_array($erros["Erros"])){
foreach ($erros["Erros"] as $key => $value) {
$('#mc-form').validate({
highlight: function(element, errorClass) {
$(element).fadeOut(function() {
$(element).fadeIn();
});
},
rules: {
name: {
required: true,
minlength: 2
Since I was looking all around how to uninstall packages and after reading tones
of documentations here's the short how-to uninstall a workbench package in Laravel
(or how I managed it to work out):
1. Remove package service provider from 'providers' array in app/config/app.php
2. Remove the package folder in workbench/
3. Run:
@marcaum54
marcaum54 / gist:9288fca85790f8d0ad9f
Created May 14, 2015 19:49
Laravel: Regex Validators
$examples = [
'cpf' => [ 'regex:/^\d{3}.\d{3}.\d{3}-\d{2}$/' ],
'cnpj' => [ 'regex:/^\d{2}.\d{3}.\d{3}\/\d{4}-\d{2}$/' ],
'telefone' => [ 'regex:/^\(\d{2}\) \d{4}-\d{4,5}$/' ],
'cep' => [ 'regex:/^\d{5}-\d{3}$/' ],
];