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
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
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateServicoTable extends Migration
{
/**
* Run the migrations.
@vicentimartins
vicentimartins / send_email.py
Created Dec 30, 2017
Teste e método para envio de email
View send_email.py
class SubscriptionEmailSenderTest(TestCase):
"""Test the send subscription email"""
def setUp(self):
self.data = {'name':'Vicente Martins', 'cpf':'012345678901',
'email':'vicente@email.com', 'phone':'83-9-88932202'}
self.response = self.client.post('/inscricao/', self.data)
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
<?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/tsearch2.so"
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/tsearch2.so"
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/tsearch2.so"
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/tsearch2.so"
ERRO: fun��o public.gtsvector_out(gtsvector) n�o existe
@vicentimartins
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)
{
parent::initialize($config);
$this->setTable('usuarios');
$this->setDisplayField('id');
$this->setPrimaryKey('id');
@vicentimartins
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 = L.map("map").setView([-7,-34], 13);
// Adicionando uma camada base ao mapa.
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
{
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors',
maxzoom: 18
@vicentimartins
vicentimartins / basemap.html
Last active Oct 14, 2016
Base to leafletjs
View basemap.html
<head>
<!-- others rules -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.1/dist/leaflet.css" />
<!-- one more rules -->
</head>
<body>
<div id="map"></div>
<!-- Others body rules -->
<script src="https://unpkg.com/leaflet@1.0.1/dist/leaflet.js"></script>
You can’t perform that action at this time.