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
customResolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...interface{}) (aws.Endpoint, error) { | |
if service == s3.ServiceID { | |
return aws.Endpoint{ | |
PartitionID: "yc", | |
URL: "https://storage.yandexcloud.net", | |
}, nil | |
} | |
return aws.Endpoint{}, fmt.Errorf("unknown endpoint requested") | |
}) |
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 | |
echoerr() { echo -e "\e[1;31m$@\e[0m" 1>&2; } | |
git diff --diff-filter=MAT --name-only --cached | while read line; | |
do | |
filename=$(tempfile)$(echo $line | sed 's/\//_/g'); | |
git show :$line > $filename; | |
if ! eval 'phpcs --standard=./vendor/escapestudios/symfony2-coding-standard/Symfony2 --extensions=php --ignore=Tests $filename > /dev/null'; then | |
if eval 'phpcs --standard=./vendor/escapestudios/symfony2-coding-standard/Symfony2 --extensions=php --ignore=Tests $line > /dev/null'; then |
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 BookerBundle\OData\Query; | |
/** | |
* Class AbstractQuery | |
*/ | |
abstract class AbstractQuery implements QueryInterface | |
{ | |
/** @return 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 | |
namespace AppBundle\EventListener\Core; | |
use Symfony\Component\HttpFoundation\JsonResponse; | |
use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; | |
use Symfony\Component\HttpKernel\KernelEvents; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
use JMS\DiExtraBundle\Annotation as DI; |
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 | |
/** | |
* Created by PhpStorm. | |
* User: anboo | |
* Date: 11.01.17 | |
* Time: 10:48 | |
*/ | |
namespace AppBundle\Service\Filter; |
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 | |
function getMobilePhone($href) { | |
$ch = curl_init('https://m.avito.ru'.$href); | |
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt ($ch, CURLOPT_FAILONERROR, 1); | |
curl_setopt ($ch, CURLOPT_ENCODING, 0); | |
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3B48b Safari/419.3'); | |
curl_setopt( $ch, CURLOPT_COOKIEJAR, 'cookie.txt'); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); | |
curl_setopt( $ch, CURLOPT_COOKIEFILE, 'cookie.txt'); |