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
map $http_referer $bad_referer { | |
hostnames; | |
default 0; | |
.semalt.com 1; | |
.kambasoft.com 1; | |
.savetubevideo.com 1; | |
.descargar-musica-gratis.net 1; | |
.7makemoneyonline.com 1; | |
.baixar-musicas-gratis.com 1; | |
.iloveitaly.com 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
# Cloudflare | |
set_real_ip_from 103.21.244.0/22; | |
set_real_ip_from 103.22.200.0/22; | |
set_real_ip_from 103.31.4.0/22; | |
set_real_ip_from 104.16.0.0/12; | |
set_real_ip_from 108.162.192.0/18; | |
set_real_ip_from 131.0.72.0/22; | |
set_real_ip_from 141.101.64.0/18; | |
set_real_ip_from 162.158.0.0/15; | |
set_real_ip_from 172.64.0.0/13; |
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
server { | |
listen 80; | |
error_log /var/log/nginx/yiisite.log; | |
server_name yiisite.loc; | |
charset utf-8; | |
root /var/www/yiisite/web; |
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
server { | |
listen 80; | |
server_name yiidreamteam.com; | |
charset utf-8; | |
root /var/www/yiidreamteam/frontend/web; | |
location / { | |
index index.php; |
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
$js = <<<JS | |
// Change hash for page-reload | |
$('.nav-tabs a').on('shown.bs.tab', function (e) { | |
window.location.hash = e.target.hash; | |
}) | |
// Javascript to enable link to tab | |
var url = document.location.toString(); | |
if (url.match('#')) { | |
$('.nav-tabs a[href=#'+url.split('#')[1]+']').tab('show') ; |
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 | |
namespace common\traits; | |
use yii\base\InvalidConfigException; | |
use yii\helpers\ArrayHelper; | |
/** | |
* Trait for default status column | |
* | |
* Class StatusTrait |
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 | |
namespace common\components; | |
/** | |
* Class ActiveRecord | |
* @package common\components | |
*/ | |
class ActiveRecord extends \yii\db\ActiveRecord | |
{ | |
/** |
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 getAssetUrl($url) | |
{ | |
return \Yii::$app->assetManager->getBundle('frontend\assets\AppAsset')->baseUrl . $url; | |
} |
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
ymaps.ready(init); | |
var myMap, myPlaceMark; | |
function init() { | |
myMap = new ymaps.Map("map", { | |
center: [<?=$model->latitude?>, <?=$model->longitude?>], | |
zoom: <?=$city->defaultZoom?>, | |
minZoom: <?=$city->minZoom?>, | |
maxZoom: <?=$city->maxZoom?>, | |
controls: ['searchControl', 'typeSelector', 'zoomControl', 'geolocationControl'] | |
}); |
OlderNewer