Skip to content

Instantly share code, notes, and snippets.

@o-shabashov
o-shabashov / php.php
Created May 29, 2016 22:40
Yii2 ActiveRecord->hasAttribute VS Model->hasProperty
<?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
@o-shabashov
o-shabashov / sql.sql
Created May 29, 2016 22:39
SQL select where name = "A..E"
select * from brand
where substr(brand_name, 1, 1) >= 'a' and substr(brand_name, 1, 1) <= 'e'
order by brand_name ASC
@o-shabashov
o-shabashov / gist:6680529
Created September 24, 2013 04:54
Linux - to change all the directories to 755 and to change all the files to 644
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 {} \;
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
@o-shabashov
o-shabashov / config.inc.php
Created September 16, 2013 04:49
Увеличить таймаут сессии PMA
$cfg['LoginCookieValidity'] = 28800; // 8 hours
find . -mtime +14 -delete