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
const TOP = 'top'; | |
const BOTTOM = 'bottom'; | |
const LEFT = 'left'; | |
const RIGHT = 'right'; | |
const OUTSIDE = 'outside'; | |
const INSIDE = 'inside'; | |
const SIDES = [TOP, RIGHT, BOTTOM, LEFT]; | |
const SIDES_LENGTH = SIDES.length; |
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
package com.example; | |
import java.util.*; | |
import java.util.logging.Logger; | |
import java.util.regex.Pattern; | |
public class Main { | |
// Use control characters for minimize chance of matches with original text | |
private static final String UGLY_HACK_MARKER = "\u0080\u0081\u0082"; |
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 | |
class IntString | |
{ | |
/** | |
* Набор символов для кодирования | |
*/ | |
const CHARSET = '0-9a-zA-Z_-'; | |
/** |
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
##################################################################################### | |
# INSTALL isolated PHP 7.2 ZTS (Thread-safe) with pthreads on Ubuntu 14.04 &16.04 ### | |
##################################################################################### | |
0) Possible dependencies | |
sudo apt-get install libxml2-dev | |
1) Install necessary bison version | |
wget http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb |
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" : { |
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
/* | |
Инструкция по использованию: | |
- заходим в раздел с аудиозаписями | |
- листаем в самый низ (чтобы прогрузились все аудиозаписи) | |
- открываем консоль браузера (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
<?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
<?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\Models; | |
use Illuminate\Http\Exception\HttpResponseException; | |
use Illuminate\Http\UploadedFile; | |
use Intervention\Image\Constraint; | |
use Intervention\Image\Exception\NotWritableException; | |
class Photo extends \Eloquent |
NewerOlder