Skip to content

Instantly share code, notes, and snippets.

Let's follow happy code!

Vicente Martins vicentimartins

Let's follow happy code!
Block or report user

Report or block vicentimartins

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:1111459be9ccedf58333fa59bf494b78
### Stage 1: Base PHP ###
FROM php:7.4-fpm-alpine as php
COPY --from=composer /usr/local/bin /usr/local/bin/
RUN apk add --update \
curl-dev \
libcurl \
libpng \
freetype \
vicentimartins / 2018_06_16_221927_create_servico_table.php
Created Jun 17, 2018
Dificuldades ao executar testes no laravel
View 2018_06_16_221927_create_servico_table.php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateServicoTable extends Migration
* Run the migrations.
vicentimartins /
Created Dec 30, 2017
Teste e método para envio de email
class SubscriptionEmailSenderTest(TestCase):
"""Test the send subscription email"""
def setUp(self): = {'name':'Vicente Martins', 'cpf':'012345678901',
'email':'', 'phone':'83-9-88932202'}
self.response ='/inscricao/',
def test_send_subscribe_email(self):
"""Subscription should have send only one mail per subscription"""
self.assertEqual(1, len(mail.outbox))
View MyController.php
class AnexoController extends Controller
private static function criar(UploadedFile $anexo)
return Anexo::create([
'nome' => $anexo->getClientOriginalName(),
'extensao' => $anexo->extension(),
'diretorio' => storage_path()."/uploads",
'tamanho' => $anexo->getSize(),
View ControllerErrado.php
// Controller
class RequerimentoController extends Controller
public function index($imovel_id, $usuario_id)
$mananciais = ManancialTipo::get();
return view('cadastro/formulario-requerimento', [
View gist:db4b1e3cdc833a97496ec99e54d864f7
This file has been truncated, but you can view the full file.
ERRO: n�o p�de encontrar fun��o "gtsq_in" no arquivo "/usr/lib/postgresql/9.1/lib/"
ERRO: fun��o public.gtsq_in(cstring) n�o existe
ERRO: n�o p�de encontrar fun��o "gtsq_out" no arquivo "/usr/lib/postgresql/9.1/lib/"
ERRO: fun��o public.gtsq_out(gtsq) n�o existe
ERRO: fun��o gtsq_in(cstring) n�o existe
ERRO: n�o p�de encontrar fun��o "gtsvector_in" no arquivo "/usr/lib/postgresql/9.1/lib/"
ERRO: fun��o public.gtsvector_in(cstring) n�o existe
ERRO: n�o p�de encontrar fun��o "gtsvector_out" no arquivo "/usr/lib/postgresql/9.1/lib/"
ERRO: fun��o public.gtsvector_out(gtsvector) n�o existe
vicentimartins / Autenticacao CakePHP 3
Last active Mar 19, 2017
Problema com autenticação no CakePHP3
View Autenticacao CakePHP 3
// UsuariosTable
class UsuariosTable extends Table
public function initialize(array $config)
vicentimartins / Route
Created Mar 14, 2017
Rota Laravel com .
View Route
app->group(['prefix' => 'status'], function () use ($app) {
$app->get('acompanhar-email/{email_id}', [
'as' => 'acompanhar-email',
'uses' => 'LogController@acompanharEmail'
// Controller
public function acompanharEmail($email_id)
View mymap.js
var App = function(){
// Criamos uma instância do leafletjs e chamamos suas
// funções map() e setView()
var map ="map").setView([-7,-34], 13);
// Adicionando uma camada base ao mapa.
attribution: 'Map data © <a href="">OpenStreetMap</a> contributors',
maxzoom: 18
vicentimartins / basemap.html
Last active Oct 14, 2016
Base to leafletjs
View basemap.html
<!-- others rules -->
<link rel="stylesheet" href="" />
<!-- one more rules -->
<div id="map"></div>
<!-- Others body rules -->
<script src=""></script>
You can’t perform that action at this time.