This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function join_array(array $array, $divider = '.') { | |
$iterator = new RecursiveArrayIterator($array); | |
$new_array = []; | |
$recursive = function (RecursiveArrayIterator $iterator, $parent = null) use (&$recursive, &$new_array, $divider) { | |
while ($iterator->valid()) { | |
$path = !is_null($parent) ? $parent . $divider . $iterator->key() : $iterator->key(); | |
if ($iterator->hasChildren()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="row"> | |
<div class="col-lg-12"> | |
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
Загрузить фотографию | |
</div> | |
<div class="panel-body" v-notifications> | |
<form :action="source" @submit.prevent="store" role="form"> | |
<div v-if="photo" class="form-group"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Бот для csgo.life | |
*/ | |
console.log('Запуск бота...'); | |
// var io = io(config.host); | |
var io = SOCKET; | |
const TYPE_HELLO = "hello"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Загружает файл на сервер | |
*/ | |
var requestQueue = [], | |
sendingRequest = false; | |
window.attachRequestToQueue = (queue) => { | |
requestQueue.push(queue); | |
doRequestQueue(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Models; | |
use Illuminate\Http\Exception\HttpResponseException; | |
use Illuminate\Http\UploadedFile; | |
use Intervention\Image\Constraint; | |
use Intervention\Image\Exception\NotWritableException; | |
class Photo extends \Eloquent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function hex2rgb($color = '#fff') | |
{ | |
$color = ltrim($color, '#'); | |
$length = strlen($color); | |
if (preg_match('/[^0-9a-f]/i', $color) or $length <> 3 && $length <> 6) { | |
throw new Exception('Invalid color format'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Presenters; | |
abstract class AbstractPresenter | |
{ | |
/** | |
* The resource that is the object that was decorated. | |
* | |
* @var mixed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Инструкция по использованию: | |
- заходим в раздел с аудиозаписями | |
- листаем в самый низ (чтобы прогрузились все аудиозаписи) | |
- открываем консоль браузера (F12 -> Консоль) | |
- вставляем код и нажимаем ENTER | |
- скачивание началось... | |
- браузер может потребовать разрешение на сохранение файлов, необходимо подтвердить действие | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'tire' | |
# Tire.configure { logger STDERR, level: 'debug' } | |
Tire.index('movie-titles') do | |
delete | |
create \ | |
settings: { | |
index: { | |
analysis: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export http_proxy= | |
export https_proxy= | |
curl -XDELETE 'http://localhost:9200/test/' | |
echo "Creating the mapping" | |
curl -XPUT 'http://localhost:9200/test/?pretty=1' -d ' | |
{ | |
"mappings" : { | |
"member" : { |
OlderNewer