Skip to content

Instantly share code, notes, and snippets.

@AntonioCS
AntonioCS / gist:83bccc7f6ecace2c3f3bcc4b9369d2ee
Last active February 11, 2021 12:37
Useful git alias for .bashrc
alias ga="git add"
alias gs="git status"
alias gc="git checkout"
alias gcb="git checkout -b"
alias gb="git branch"
alias gp="git pull"
alias gd="git diff"
alias gcom="git commit"
@AntonioCS
AntonioCS / mariadb_uuid_v4.sql
Created September 22, 2021 13:22
Functions for MariaDB to be able to convert to and from uuid v4 which is normally stored as BINARY(16)
DROP FUNCTION IF EXISTS uuid_v4;
DROP FUNCTION IF EXISTS BIN_TO_UUID;
DROP FUNCTION IF EXISTS UUID_TO_BIN;
-- Change delimiter so that the function body doesn't end the function declaration
DELIMITER //
CREATE FUNCTION uuid_v4()
RETURNS CHAR(36) NO SQL
BEGIN
@AntonioCS
AntonioCS / HasEntityManager.php
Created January 10, 2022 14:56
A trait for symfony to simplify adding the EntityManager to a class
<?php
declare(strict_types=1);
namespace App\Traits;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\Persistence\ObjectRepository;
trait HasEntityManager
{