Skip to content

Instantly share code, notes, and snippets.

View luisdalmolin's full-sized avatar
👨‍💻

Luís Dalmolin luisdalmolin

👨‍💻
View GitHub Profile
@luisdalmolin
luisdalmolin / gravatar.php
Created December 15, 2011 23:49
Pegando imagem do Gravatar com PHP
<?php
function getAvatar() {
$email = 'seu@email.com.br'; // e-mail de cadastro para pegar as imagens
$default = '_img/sem-imagem-perfil.png'; // imagem alternativa para se não existir
$size = 25; // tamanho da imagem
$grav_url = "http://www.gravatar.com/avatar/" . md5( strtolower( trim( $email ) ) ) .
"?d=" . urlencode( $default ) . "&s=" . $size;
return $grav_url;
}
@luisdalmolin
luisdalmolin / gist:1446953
Created December 8, 2011 13:12
EscapeWork
<?php
$Produto = EscapeWork::getClass('Produto');
@luisdalmolin
luisdalmolin / SoapHeader.php
Created July 26, 2011 15:07
Solução SOAP Header
<?php
$xml = '<Credenciais xmlns="http://sofis.com.br/"><codigo>'.self::CODIGO.'</codigo><senha>'.self::SENHA.'</senha></Credenciais>';
$soapAuthVar = new SoapVar($xml, XSD_ANYXML, null, null, null);
$soapAuthHeader = new SoapHeader(self::WSDL, 'Credenciais', $soapAuthVar);
$this->soap->__setSoapHeaders( array($soapAuthHeader) );
@luisdalmolin
luisdalmolin / gist:1106838
Created July 26, 2011 14:02
Webservice SOAP
POST /servico/nododoarquivo.asmx HTTP/1.1
Host: sofis.servehttp.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://servidor/NomeDaFuncao"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<Credenciais xmlns="http://sofis.com.br/">