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 AsyncProcess | |
{ | |
private int $pid; | |
private string $command; | |
/** | |
* AsyncProcess constructor. | |
* @param string $command | |
*/ |
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
#!/usr/bin/python | |
import sys | |
import os | |
from CoreGraphics import * | |
fileName = sys.argv[1] | |
inputDoc = CGPDFDocumentCreateWithProvider(CGDataProviderCreateWithFilename(fileName)) |
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
private function feedData(): void | |
{ | |
$productFile = new \SplFileObject($this->productFilePath); | |
$productFile->fgetcsv();//ignore headline | |
while ($data = $productFile->fgetcsv()) { | |
list($rowIdx, $title, $price, $retailer, $rating, $desc) = $data; | |
$doc = array_merge( | |
$this->indexDefinition, | |
[ |
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\Command; | |
use Elasticsearch\Client; | |
use Symfony\Component\Console\Command\Command; | |
use Symfony\Component\Console\Input\InputArgument; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Output\OutputInterface; |
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
FROM php:7.4-fpm-alpine | |
RUN docker-php-ext-install opcache | |
# Use the default production configuration | |
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" | |
ADD ./override.ini $PHP_INI_DIR/conf.d/ |
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
version: '3' | |
php_api: | |
image: dockerwest/php-symfony:7.2 | |
container_name: php | |
volumes: | |
- ./:/var/www | |
environment: | |
- APP_ENV=dev | |
- DEVELOPMENT=1 | |
- PHP_EXTRA_MODULES=xdebug |
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
fastcgi_cache_path /var/cache/nginx levels=1:2 keys_zone=fpmcache:100m max_size=10g inactive=60m use_temp_path=off; | |
fastcgi_cache_key "$request_uri|$request_body"; | |
fastcgi_cache_methods POST; | |
server { | |
server_tokens off; | |
listen 80 default_server; | |
server_name server_name _; | |
access_log /dev/stdout; | |
error_log /dev/stderr; |
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 | |
$lev = levenshtein($subname, $parts[$i]); | |
if ($lev <= \strlen($subname) / 3 || '' !== $subname && false !== strpos($parts[$i], $subname)) { | |
$alternatives[$collectionName] = $exists ? $alternatives[$collectionName] + $lev : $lev; | |
} elseif ($exists) { | |
$alternatives[$collectionName] += $threshold; | |
} |
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 Person | |
*/ | |
class Person implements JsonSerializable | |
{ | |
/** | |
* @var string | |
*/ |
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 | |
$array = [ | |
[ | |
'name' => 'Misty', | |
'age' => 15 | |
], | |
[ | |
'name' => 'Charlie', | |
'age' => 40 |
NewerOlder