Skip to content

Instantly share code, notes, and snippets.

View korchasa's full-sized avatar
💭
(╯°□°)╯︵ ┻━┻

Stanislav Korchagin korchasa

💭
(╯°□°)╯︵ ┻━┻
View GitHub Profile
@korchasa
korchasa / api_of_dream.md
Last active August 29, 2015 14:12
api_of_dream.md

Web API моей мечты

Смешная цитата


Его разработчики любят своих клиентов

  • API для программиста так же важен, как UI для пользователя
  • Программисты - «клиенты» API. Простота интеграции -> больше клиентов.
  • Клиенты важнее религии (rest и много запросов)
{
"sys": {
"type": "Array"
},
"total": 1,
"skip": 0,
"limit": 100,
"items": [
{
@korchasa
korchasa / ddl.json
Last active August 29, 2015 14:14
DDL
{
"payer_address": {
"title": "Адрес регстрации Плательщика",
"type": "text"
},
"amount": {
"title": "Сумма",
"type": "integer",
"rules": [
["min", 1, "Минимальная сумма платежа - 1 рубль"],
@korchasa
korchasa / HipChatLogFormatter.php
Last active August 29, 2015 14:14
HipChat API v2 formatter and handler for Monolog
<?php namespace App;
use Monolog\Formatter\HtmlFormatter;
/**
* Serializes a log message to HipChat message
*
* @see http://logstash.net/
* @see https://github.com/logstash/logstash/blob/master/lib/logstash/event.rb
*
# Feel free to change this path of course (and keys_zone value as well, but also change the usage of it below).
proxy_cache_path /var/www/cache/resized levels=1:2 keys_zone=resizedimages:10m max_size=1G;
# Gzip was on in another conf file of mine...You may need to uncomment the next line.
#gzip on;
gzip_disable msie6;
gzip_static on;
gzip_comp_level 4;
gzip_proxied any;
# Again, be careful that you aren't overwriting some other setting from another config's http {} section.
<?php
/**
* @param $log_name
* @param array $guzzle_options
* @return \GuzzleHttp\Client
*/
function logging_guzzle($log_name, array $guzzle_options = [])
{
$log_file = storage_path('logs/' . $log_name . '.log');
@korchasa
korchasa / find_not_tests.php
Created March 23, 2016 13:59
Find not a test with valid phpunit suffix
<?php
require_once __DIR__.'/../src/test/bootstrap.php';
$finder = new \Symfony\Component\Finder\Finder();
$finder->in(__DIR__.'/../src')
->name('*Test.php')
->files();
foreach($finder as $file) {
@korchasa
korchasa / find_bad_phpunit_suffix.php
Created March 24, 2016 12:30
Find phpunit tests with wrong name (not a "*Test.php")
#!/usr/bin/env php
<?php
require_once __DIR__.'/../src/test/bootstrap.php';
$finder = new \Symfony\Component\Finder\Finder();
$finder->in(__DIR__.'/../src')
->name('*.php')
->files();
@korchasa
korchasa / tikiwiki2markdown.php
Created June 23, 2016 11:16
Download from tikiwiki and convert to markdown
<?php
/**
* Convert tikiwiki to reStructuredText
*/
$begin_symbol = '<div id="page-data" class="clearfix">';
$end_symbol = '<hr class="hrwikibottom" />';
$url_mask = 'https://help.megaplan.ru/tiki-print.php?page=%s';
https://afisha.yandex.ru/?city=moscow
https://audience.yandex.ru/
https://auto.ru/?from=all-services
https://avia.yandex.ru/?utm_source=yamain&utm_medium=popup&utm_campaign=allru
https://browser.yandex.ru/desktop/main/?from=prov_all
https://calendar.yandex.ru/
https://delivery.yandex.ru/promo/
https://direct.yandex.ru/?from=all
https://disk.yandex.ru/?source=services-main
https://dns.yandex.ru/