This file contains hidden or 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
$data = ["counter" => [ | |
"name" => "test8898", | |
"site" => "ucalc.pro" | |
] | |
]; | |
$json = json_encode($data); | |
$curl = curl_init(); | |
curl_setopt($curl, CURLOPT_URL, "https://api-metrika.yandex.ru/management/v1/counters?oauth_token=$token_metric"); | |
curl_setopt($curl, CURLOPT_HTTPHEADER,['Content-Type: application/json']); |
This file contains hidden or 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
/** | |
* Преобразование чисел в латинские буквы, комбинация букв | |
* @param {integer} num - число для преобразования | |
* @returns {string} возвращаемое значение буквы | |
*/ | |
function numLetterLatin(num) { | |
var num_memo = num, // сколько осталось преобразовать после предыдущего шага | |
num_tail = num, // сколько останется преобразовать после этого шага | |
num_now = 0, // какое число преобразуем в букву | |
count = 0, |
This file contains hidden or 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
<div class="container"> | |
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
<button type="button" class="btn btn-default btn-xs spoiler-trigger" data-toggle="collapse">Toggle Button</button> | |
</div> | |
<div class="panel-collapse collapse out"> | |
<div class="panel-body"> | |
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sint, quos, accusamus. Quidem, molestiae. Ipsam consequatur impedit voluptatem, quod qui perferendis fugiat. Eos adipisci dolorem doloremque quos debitis excepturi ex itaque!</p> | |
</div> | |
</div> |
This file contains hidden or 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
{!! Form::hidden('name_field', 0) !!} | |
{!! Form::checkbox('name_field', 1, $model->name_field == 1 ? true : false) !!} |
This file contains hidden or 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
public static function getHierarchy() { | |
$options = []; | |
$parents = self::find()->where("parent_id=0")->all(); | |
foreach($parents as $id => $p) { | |
$children = self::find()->where("parent_id=:parent_id", [":parent_id" => $p->id])->all(); | |
$child_options = []; | |
foreach($children as $child) { |
This file contains hidden or 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
public function getName() { | |
$path = explode('\\', __CLASS__); | |
return array_pop($path); | |
} |
This file contains hidden or 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 | |
// Compare all values by a json_encode | |
$diff = array_diff(array_map('json_encode', $array1), array_map('json_encode', $array2)); | |
// Json decode the result | |
$diff = array_map('json_decode', $diff); |
This file contains hidden or 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
<li class="error">{ $error }}</li> |
This file contains hidden or 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 | |
Validator::extend('max_mb', function($attribute, $value, $parameters, $validator) { | |
if ( $value instanceof UploadedFile && ! $value->isValid() ) { | |
return false; | |
} | |
// If call getSize()/1024/1024 on $value here it'll be numeric and not | |
// get divided by 1024 once in the Validator::getSize() method. | |
$megabytes = $value->getSize() / 1024 / 1024; | |
return $megabytes <= $parameters[0]; |
This file contains hidden or 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
body { | |
background-color: #1B2B34; | |
font-size: 62.5%; | |
font-family: sans-serif; | |
color: #00273B; | |
} | |
.app-cont { | |
display: flex; | |
justify-content: center; |
OlderNewer