Skip to content

Instantly share code, notes, and snippets.

View ezequidias's full-sized avatar

Ezequiel D. ezequidias

View GitHub Profile
@MrPunyapal
MrPunyapal / LaravelWhereLikeMacro.php
Last active April 12, 2024 03:32
Laravel Custom 'whereLike' Macro for Dynamic 'LIKE' Searches including relationships
<?php
namespace App\Providers;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Arr;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
@luizomf
luizomf / ambiente-dev-ubuntu-curso-python.sh
Created October 31, 2022 01:23
Instalação ambiente dev Ubuntu 22 do curso de Python
#!/bin/bash
# Executar comandos a seguir para atualizar os pacotes
sudo apt update -y
sudo apt upgrade -y
# Só o Python
sudo apt install python3.10-full python3.10-dev -y
# Instalar pacotes a seguir
@rodrigopedra
rodrigopedra / gist:a4a91948bd41617a9b1a
Last active March 30, 2024 16:30
Laravel 5 Middleware for Database Transactions
<?php namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Response;
class DBTransaction
{
/**
* Handle an incoming request.
*
@rdeavila
rdeavila / pgsql-size.sql
Last active February 7, 2024 09:26
PostgreSQL: Como ver o tamanho das bases de dados de um servidor
-- Para saber o tamanho de todas as bases de dados:
SELECT pg_database.datname, pg_size_pretty(pg_database_size(pg_database.datname)) AS size FROM pg_database;