Skip to content

Instantly share code, notes, and snippets.

@andreypaa
andreypaa / config-git-proxy.txt
Created September 26, 2018 06:47 — forked from bynil/config-git-proxy.txt
Use git over socks5 proxy
Port: 1080
1. Create a file /YOUR PATH/gitproxy.sh with content:
#!/bin/sh
nc -X 5 -x 127.0.0.1:1080 "$@"
2. Edit your ~/.gitconfig
# For git://
location / {
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php(/|$) {
fastcgi_pass php-fpm5:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
@andreypaa
andreypaa / ParseHTML.php
Created February 14, 2020 07:57
table2params
<?php
namespace App\Service;
use DOMDocument;
use DOMElement;
use DOMNode;
use DOMXPath;
class ParseHTML
<?php
parse();
function parse()
{
$html = get_html('https://velsnab.ru/price/');
$fn = __DIR__.'/velsnab.ru_'.time().'.csv';
if ($html) {
@andreypaa
andreypaa / remove-message.js
Created July 31, 2020 12:57 — forked from simonw/remove-message.js
JavaScript one-liner for removing a ?message=... parameter from the visible URL in the browser
history.replaceState && history.replaceState(
null, '', location.pathname + location.search.replace(/[\?&]message=[^&]+/, '').replace(/^&/, '?')
);
@andreypaa
andreypaa / CDEK.php
Created November 9, 2021 17:24
CDEK
<?php
namespace App\Service\TransportService;
use App\Service\CacheService;
use App\Service\Request;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
final class CDEK extends TransportService
@andreypaa
andreypaa / PageSpeed.php
Created November 9, 2021 17:25
PageSpeed
<?php
namespace App\Service;
use App\Entity\Page;
use Doctrine\DBAL\Exception;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
require 'compass/import-once/activate'
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "templates"
sass_dir = "templates"
images_dir = "templates"
javascripts_dir = "templates"
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Хост: mariadb
-- Время создания: Фев 25 2022 г., 09:38
-- Версия сервера: 10.5.11-MariaDB-1:10.5.11+maria~focal
-- Версия PHP: 7.4.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
{"items":[{"category_id":434864420,"dimension_unit":"cm","depth":130,"width":60,"height":21,"weight_unit":"kg","weight":20,"vat":"0.2","price":"24750","offer_id":"9980070738014","name":"Aspect Champion (2022)","images":["https:\/\/pro-bike.loc\/data\/images\/catalog\/57\/34657\/1.jpg","https:\/\/pro-bike.loc\/data\/images\/catalog\/57\/34657\/2.jpg"],"complex_attributes":[],"attributes":[{"complex_id":0,"id":"85","values":[{"value":"Aspect"}]},{"complex_id":0,"id":"4180","values":[{"value":"Детский велосипед Aspect Champion (2022)"}]},{"complex_id":0,"id":"7710","values":[{"value":"Хардтейл"}]},{"complex_id":0,"id":"7712","values":[{"value":"20\""}]},{"complex_id":0,"id":"7715","values":[{"value":"Zoom 565"}]},{"complex_id":0,"id":"7723","values":[{"value":"Алюминий"}]},{"complex_id":0,"id":"7727","values":[{"value":"Один размер"}]},{"complex_id":0,"id":"7916","values":[{"value":"6"}]},{"complex_id":0,"id":"7917","values":[{"value":"80мм."}]},{"complex_id":0,"id":"9048","values":[{"value":"Champion"}]},{"comp