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
find . -mtime +14 -delete |
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
$cfg['LoginCookieValidity'] = 28800; // 8 hours |
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
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install oracle-java7-installer |
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
to change all the directories to 755: | |
find /opt/lampp/htdocs -type d -exec chmod 755 {} \; | |
to change all the files to 644: | |
find /opt/lampp/htdocs -type f -exec chmod 644 {} \; |
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
select * from brand | |
where substr(brand_name, 1, 1) >= 'a' and substr(brand_name, 1, 1) <= 'e' | |
order by brand_name ASC |
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 ContactForm extends Model | |
$contact = new ContactForm(); | |
// class User extends \yii\db\ActiveRecord | |
$user = new User(); | |
isset($contact->email); // false | |
$contact->hasProperty('email'); // true |
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 | |
// Global in config/web.php | |
'components' => [ | |
// ... | |
'assetManager' => [ | |
'forceCopy' => YII_DEBUG, | |
], | |
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 DistanceHelper { | |
/** | |
* @param string | float $from | |
* @param string | float $to | |
* | |
* @return object | |
*/ | |
public static function calculate($from, $to) { |
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 | |
$interval = 'DAY'; | |
//$interval = 'WEEK'; | |
//$interval = 'MONTH'; | |
$brands = BrandExt::find() | |
->where([ | |
'between', | |
'brand.created_at', | |
new Expression(sprintf('date_sub(utc_timestamp, interval 1 %s)', $interval)), |
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 | |
// Stored in session | |
Url::remember(['brands/vanity-iew', 'brand' => $brand->vanity_url], 'return-url'); | |
// Redirect if exist | |
if (Url::previous('return-url')) { | |
return $this->redirect(Url::previous('return-url')); | |
} |
OlderNewer