Skip to content

Instantly share code, notes, and snippets.

View POMXARK's full-sized avatar
🏠
Нет предела совершенству.

Бушуев Роман POMXARK

🏠
Нет предела совершенству.
View GitHub Profile
@POMXARK
POMXARK / QueryBuilderToSql.php
Created September 10, 2024 05:01
symfony DQL Doctrine - Преобразует QueryBuilder в сырой SQL-запрос.
<?php
namespace App\Helper;
use DateTimeImmutable;
use Doctrine\ORM\QueryBuilder;
class QueryBuilderToSql
{
/**
@POMXARK
POMXARK / CustomNamingStrategy.php
Created September 10, 2024 04:59
symfony, Doctrine - CustomNamingStrategy
<?php
namespace App\Doctrine;
use Doctrine\ORM\Mapping\DefaultNamingStrategy;
use Doctrine\ORM\Mapping\NamingStrategy;
class CustomNamingStrategy extends DefaultNamingStrategy implements NamingStrategy
{
/**
Если страна отеля (равно | не равно) countries.id
SELECT *
FROM countries
JOIN cities ON countries.id = cities.country_id
JOIN hotels ON cities.id = hotels.city_id
WHERE countries.id = 1 AND hotels.id = 1
Если город отеля (равно | не равно) cities.id
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL
);
CREATE TABLE conversations (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
@POMXARK
POMXARK / DBA
Last active July 16, 2024 13:19
DBA helper
sudo service mysql stop
sudo service mysql start
@POMXARK
POMXARK / parallax-scroll-effect.html
Created July 7, 2024 07:44
parallax-scroll-effect
// https://codepen.io/chen1223/details/pqZWbg
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<style>
@import url('https://fonts.googleapis.com/css?family=Roboto+Condensed');
@POMXARK
POMXARK / index.html
Created July 6, 2024 05:26
Home Image parallax effect [GSAP + Lenis]
<section>
<div class="img">
<div class="img-container">
<img src="https://images.unsplash.com/photo-1498598457418-36ef20772bb9?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1200&q=80" />
</div>
</div>
</section>
<section>
<div class="img">
<div class="img-container">
@POMXARK
POMXARK / docker_wordpress.md
Created July 3, 2024 19:26 — forked from bradtraversy/docker_wordpress.md
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@POMXARK
POMXARK / Repository.php
Last active June 9, 2024 06:28
phpstorm file templates -> Laravel DDD Domain Service
// app/Repositories/${NAME}Repository
<?php
#parse("PHP File Header.php")
namespace App\Repositories;
class ${NAME}Repository implements ${NAME}RepositoryInterface
{
<?php
class UserRepository
{ }
class UserController {
private $userRepository;
public function __construct(UserRepository $repository)
{