Skip to content

Instantly share code, notes, and snippets.

View anboo's full-sized avatar
🏠
Working from home

Danil Andreev anboo

🏠
Working from home
  • Almaty
  • 21:32 (UTC +03:00)
View GitHub Profile
@anboo
anboo / s3.go
Created January 2, 2024 08:52
Yandex cloud S3 storage example connect from golang aws S3
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")
})
#!/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
<?php
namespace BookerBundle\OData\Query;
/**
* Class AbstractQuery
*/
abstract class AbstractQuery implements QueryInterface
{
/** @return string */
<?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;
@anboo
anboo / FilterFactory.php
Created January 11, 2017 08:04
LexikFormFilterHelper
<?php
/**
* Created by PhpStorm.
* User: anboo
* Date: 11.01.17
* Time: 10:48
*/
namespace AppBundle\Service\Filter;
`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');