This file contains hidden or 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 | |
| abstract class MealPrototype | |
| { | |
| protected $mealName; | |
| protected $mealCategory; | |
| public function getMealName(): string | |
| { | |
| return $this->mealName; |
This file contains hidden or 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 WorkerEntity | |
| { | |
| private $workerId; | |
| private $workerName; | |
| public function __construct($workerId, $workerName) | |
| { | |
| $this->workerId = $workerId; |
This file contains hidden or 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
| # This is a basic workflow to help you get started with Actions | |
| name: Build And Deploy | |
| # Controls when the workflow will run | |
| on: | |
| # Triggers the workflow on push or pull request events but only for the "main" branch | |
| push: | |
| branches: [ "main" ] | |
| pull_request: |
This file contains hidden or 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\Controller; | |
| use App\Repository\PostRepository; | |
| use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | |
| use Symfony\Component\HttpFoundation\Response; | |
| use Symfony\Component\Routing\Annotation\Route; | |
| use Symfony\Component\Routing\Generator\UrlGeneratorInterface; |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" | |
| xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> | |
| {% for url in urls %} | |
| <url>{# check if hostname is not alreay in url#} | |
| <loc>{{ url.loc }}</loc> | |
| {% if url.lastmod is defined %} | |
| <lastmod>{{url.lastmod}}</lastmod> |
This file contains hidden or 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 | |
| use Aws\S3\S3Client; | |
| use Symfony\Component\HttpFoundation\Request; | |
| // settings | |
| $client = new S3Client([ | |
| 'version' => 'latest', | |
| 'region' => '{REGION}', | |
| 'endpoint' => 'https://{REGION}.digitaloceanspaces.com', |
This file contains hidden or 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
| const handleImageUpload = (e: any) => { | |
| const file = e.target.files[0]; | |
| const reader = new FileReader(); | |
| reader.readAsDataURL(file); | |
| reader.onloadend = () => { | |
| console.log(reader.result); | |
| // make request to your backend | |
| }; | |
| }; |
This file contains hidden or 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 View | |
| { | |
| public function render($name) | |
| { | |
| echo "Rendering view $name"; | |
| } | |
| } |
This file contains hidden or 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 | |
| $array = []; | |
| for ($i = 0; $i < 10000; $i++) { | |
| $array[] = $i; | |
| } | |
| $start = microtime(true); | |
| foreach ($array as $k => $v) { |
This file contains hidden or 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 | |
| $array = []; | |
| for ($i = 0; $i < 10000; $i++) { | |
| $array[] = $i; | |
| } | |
| $start = microtime(true); | |
| foreach ($array as $k => $v) { |