Skip to content

Instantly share code, notes, and snippets.

View Borodin's full-sized avatar
📷
http://tour-360.ru

Maxim Borodin Borodin

📷
http://tour-360.ru
View GitHub Profile
@Borodin
Borodin / DSM.js
Last active August 29, 2015 14:00
var feeds = [
[1, 3, 1, 2], // Жиры, белки, углеводы, нитраты первого корма
[3, 1, 8, 4], // Второго корма
[2, 5, 8, 1] // Третья корма
]
var rate = [6, 9, 8, 16]; // Количество необходимых веществ
var cost = [800, 10, 45]; // Цена первого и виторого корма
/*========================[ Решение ]===========================*/
<?php
header('Content-Type: text/html; charset=utf-8');
$mbox = imap_open("{server143/notls}INBOX.Sent", 'login', 'pass') or die("can't connect: " . imap_last_error());;
$total_count = imap_num_msg($mbox);
function header_decode($str){
$header = imap_mime_header_decode(imap_utf8($str));
return ($header[0]->charset=='default')? $header[0]->text : iconv($header[0]->charset, 'UTF-8', $header[0]->text);
}
var a = [30, 48, 20, 30]; // Запасы
var b = [18, 27, 42, 26, 15]; // Заявки
var n = [
[ 13, 7, 14, 7, 5],
[ 11, 8, 12, 6, 8], //Затраты на доставку
[ 6, 10, 10, 8, 11],
[ 14, 8, 10, 10, 15]
];
@Borodin
Borodin / captha.php
Last active December 27, 2015 06:19
<?
header('Content-Type: image/jpeg');
$im = imagecreatetruecolor(175, 60);
imagefill($im, 0, 0, imagecolorallocate($im, 240, 240, 240));
for($i=0; $i<5; $i++)imagettftext($im, 16, 0, 10+30*$i, 40, imagecolorallocate($im, 100, 100, 100), 'arial.ttf', rand(0, 9));
imagepng($im);
imagedestroy($im);
//imagecreatetruecolor(width, height)
//imagefill(image, x, y, color);
@Borodin
Borodin / upload_file.html
Last active November 2, 2023 01:05
Upload file javascript
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Upload</title>
</head>
<body>
<?php
if($_FILES['image']['tmp_name']){
{"Data":[{"QuestionId":25600,"OneAnswer":102536},{"QuestionId":25623,"OneAnswer":102656},{"QuestionId":25587,"OneAnswer":102473},{"QuestionId":39869,"OneAnswer":156609},{"QuestionId":39895,"OneAnswer":156717},{"QuestionId":39854,"OneAnswer":156535},{"QuestionId":39822,"ManyAnswers":[156400,156401,156402]},{"QuestionId":25632,"OneAnswer":102705},{"QuestionId":39853,"OneAnswer":156530},{"QuestionId":39821,"OneAnswer":156397},{"QuestionId":25644,"OneAnswer":102762},{"QuestionId":25677,"OneAnswer":102926},{"QuestionId":39800,"OneAnswer":156288},{"QuestionId":39871,"OneAnswer":156616},{"QuestionId":25586,"OneAnswer":102468},{"QuestionId":25635,"OneAnswer":102722},{"QuestionId":25664,"OneAnswer":102855},{"QuestionId":39897,"OneAnswer":156724},{"QuestionId":39837,"OneAnswer":156464},{"QuestionId":25657,"OneAnswer":102818}]}
@Borodin
Borodin / index.js
Last active December 13, 2015 19:58 — forked from jankuca/index.js
var stdout = process.stdout;
var info = console.info;
var warn = console.warn;
var error = console.error;
var DEFAULT = "\033[m";
var BLUE = "\033[1;36m";
var YELLOW = "\033[1;33m";
var RED = "\033[1;31m";