This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# REQUIRES ROOT ACCESS TO DUMP ALL THE PROCEDURES TRIGGERS ETC. | |
source .env | |
DATE_TIME=$(date +%Y-%m-%d__%H_%M_%S) | |
BACKUP_FILE="${DB_DATABASE}_backup_${DATE_TIME}.sql" | |
docker exec project-mysql_database-1 mysqldump -h $DB_HOST -u root -p"$DB_ROOT_PASSWORD" $DB_DATABASE --single-transaction --routines --triggers > $BACKUP_FILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DB_CONTAINER_NAME = 'mysql-container-1' | |
DB_PASSWORD = 'secret' | |
DB_NAME = 'db' | |
DB_USER = 'db_user' | |
DB_PORT = 3306 | |
DB_HOST = 'db-host' | |
docker exec -i $DB_CONTAINER_NAME mysql -h $DB_HOST -P $DB_PORT -u $DB_USER -p$DB_PASSWORD $DB_NAME < dump.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Providers; | |
use App\Patches\LogManager; | |
use Illuminate\Log\LogServiceProvider; | |
use Illuminate\Support\Facades\Log; | |
class CustomLogServiceProvider extends LogServiceProvider | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# provide directory of the repo | |
cd $1; | |
echo "------------- COMMITS ------------"; | |
echo " "; | |
git log --pretty=format:"%an" | sort | uniq -c | sort -nr | awk ' | |
BEGIN { total_commits=0 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @property-read int $someProp | |
* @property int $otherProp | |
*/ | |
class User {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class User extends Authenticatable implements JWTSubject | |
{ | |
protected function customFields(): Attribute | |
{ | |
return Attribute::make( | |
get: fn (?string $value) => (object)json_decode($value), | |
set: fn (array|object $value) => json_encode($value, JSON_FORCE_OBJECT), | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace App\Models; | |
use App\Models\Passport\Client; | |
use Database\Factories\UserFactory; | |
use Illuminate\Database\Eloquent\Builder; | |
use Illuminate\Database\Eloquent\Factories\HasFactory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RESPONSE=$(curl --location --insecure --request POST 'http://server.local/oauth/token' \ | |
--header 'Content-Type: application/x-www-form-urlencoded' \ | |
--data-urlencode 'grant_type=password' \ | |
--data-urlencode 'client_id=123' \ | |
--data-urlencode 'client_secret=456' \ | |
--data-urlencode 'username=admin' \ | |
--data-urlencode 'password=123' \ | |
--data-urlencode 'scopes=full_access email openid') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Feature; | |
use Symfony\Component\HttpFoundation\Request; | |
use Tests\TestCase; | |
class BrandResolveByMultipleDomainsTest extends TestCase | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# first ensure the system is full updated | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get dist-upgrade | |
# first search the proper kernel | |
apt-cache search linux-image |
NewerOlder