Skip to content

Instantly share code, notes, and snippets.

Avatar

Anton Belonovich binary-data

  • Tolyatti, Russia
View GitHub Profile
View simulation.py
DAYS = 20
DEVS_COUNT = 4
QA_COUNT = 2
def run():
tasks = {
'in_progress': 0,
'testing': 0,
'rc': 0,
View 1.html
<script>
jQuery("#termpopup_label").click(function(event) {
jQuery("#termpopup").show();
return false;
});
jQuery("#termpopup button, #termpopup #termpopup_close").click(function(event) {
jQuery("#termpopup").hide();
return false;
});
</script>
@binary-data
binary-data / resize.php
Created Jan 14, 2016
PHP resize image by width or heigth or both
View resize.php
<?php
/**
* Basic function for resize. It doesn't save image. To save use imagejpeg()
*/
function resize($width = null, $height = null)
{
if (!$width && !$height) {
return false;
}
View habraproxy.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Требования: нужна библиотека beautifulsoup4 версии не ниже 4.4.1:
# "pip install beautifulsoup4"
#
# Запуск возможен с тремя параметрами:
# -host - хост сервера, по умолчанию localhost
# -port - порт сервера, по умолчанию 8000
# -site - адрес сайта, без "http://". По умолчанию: habrahabr.ru
View gist:f1e5608650afea28d4ff
<?php
class Search extends Controller {
/**
* @var Elasticsearch\Client
*/
private $client;
public function before() {