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 | |
function mpu($label = '', $real_usage = false){ | |
//return false; // disable | |
$mpu = round(memory_get_peak_usage($real_usage) / 1024 / 1024, 2); | |
$text = "{$label} {$mpu} MB"; | |
if (function_exists('dump')) | |
dump($text); | |
else | |
echo "<div style='background-color:black; color:white;padding: 1em;'>{$text}</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
<script> | |
// classes: input.select-all, input.select-item, .select-title | |
document.addEventListener("DOMContentLoaded", function() { | |
$('input.select-all').click(function(){ | |
var value = ($(this).prop('checked')); | |
$('input.select-item').each(function(){ | |
$(this).prop('checked', value); | |
}) | |
}); |
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 | |
use Illuminate\Database\Eloquent\Model; | |
class ModelWithSlug extends Model | |
{ | |
public function setSlugAttribute($val) | |
{ | |
$val = trim($val); | |
$val = str_slug($val); |
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
<select2 :options="brands" v-model="form.brand_id" class="form-control" id="product_brand" name="product[brand_id]"> | |
<option value="" selected="true" disabled="disabled">Выбeрите бренд из списка</option> | |
</select2> |
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
<!-- RAW declaration--> | |
<div class="vue-render"> | |
<pagination :total.number="55" :current.number="1" :per_page.number="16"></pagination> | |
</div> | |
<!-- inside wrapper --> | |
<div class="vue-render"> | |
<items-list-pages> | |
<pagination :total.number="55" :current.number="1" :per_page.number="16"></pagination> | |
</items-list-pages> |
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
/** | |
* Created by maynagashev on 21.04.17. | |
*/ | |
/** | |
* Shared Object for storing current Active Filter settings, used in: | |
* @components: moments-list, filter-bar, load-more | |
* | |
* + historyAPI (write and read new status) | |
* |
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 | |
error_reporting(E_ALL); | |
ini_set('display_errors', 1); |
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
class pinbaWrapper { | |
private $pinbaEnabled; | |
public function __construct() { | |
$this->pinbaEnabled = extension_loaded('pinba'); | |
} | |
public function __call($name, $arguments) { | |
if (!$this->pinbaEnabled) return 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
<div class="wrapper tiles"> | |
@foreach($articles as $d) | |
{{$d->title}} | |
<input type="hidden" class="article-id" name="article-id" value="{{$d->id}"> | |
@endforeach | |
</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
// Other versions | |
/** | |
* Smooth by Moving Average algorithm with prevData measurements data (optional) | |
* ---------------------------- | |
* USING COLLECTIONS VERY SLOW! | |
* ---------------------------- | |
* @param $data | |
* @param $len |
NewerOlder