Skip to content

Instantly share code, notes, and snippets.

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 23, 2024 10:19
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@Alexander-Pop
Alexander-Pop / mag2-redirect.php
Last active June 11, 2024 12:19
Magento 2 - redirect programmatically #magento2 #module #redirect
<?php
//In controller:
//No need to declare $this->resultRedirectFactory in construct as its auto declared in construct of \Magento\Framework\App\Action\Action to which custom controller should extend.
public function execute()
{
$resultRedirect = $this->resultRedirectFactory->create();
$resultRedirect->setPath('routename/controllerpath/controllername');
$resultRedirect->setPath('');//home
return $resultRedirect;
@alejobit
alejobit / DatabaseHandler.php
Last active March 12, 2024 15:33
Symfony Monolog database handler
<?php
namespace App\Monolog;
use App\Entity\Client;
use App\Entity\Log;
use App\Entity\User;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\ORMException;
use Monolog\Handler\AbstractProcessingHandler;
@maximevalette
maximevalette / OVH_Keystone_v3.md
Last active June 28, 2022 11:56
Sample PHP script to use Keystone v3 with OVH credentials (username + password)

OVH + PHP + Keystone v3

Install PHP OpenCloud

composer require php-opencloud/openstack ^3.0

Sample token authentication with OVH credentials

<?php
@Neeraj1005
Neeraj1005 / add-ckeditor-in-laravel-livewire.md
Last active January 14, 2024 19:39
Add CKEDITOR in Laravel-Livewire

textarea tag field

<div wire:ignore class="form-group row">
    <x-label class="col-md-3 col-form-label" for="message" :value="__('Compose message')" />
    <div class="col-md-9">
        <textarea wire:model="message" class="form-control required" name="message"
            id="message"></textarea>
        <x-error-message :value="__('message')" />
    </div>
</div>