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 | |
namespace app\models; | |
// proper update unique validation solution:-- https://stackoverflow.com/a/44473290 | |
use Yii; | |
use yii\base\Model; | |
class UserUpdateForm extends Model |
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 | |
namespace app\models; | |
use Yii; | |
use yii\base\Model; | |
class UserCreateForm extends Model | |
{ | |
public $name; |
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
vue dating | |
========================= | |
1. picker: vuejs-datepicker | |
2. from laravel (j.n.Y) to js date(d.M.yyyy) with date-fns | |
=> this.start = parse(this.currentObj.start_date, 'd.M.yyyy', new Date()); | |
3. from js date to laravel (j.n.Y) date | |
=> this.form.start_date = format(this.start, 'd.M.yyyy'); |
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 | |
=> factory(App\User::class)->create(); | |
=> factory(App\User::class, 10)->create(); | |
=> artisan help make:factory | |
=> artisan make:factory ArticleFactory -m "App\Article" | |
=> $factory->define(Article::class, function(Faker $faker){ | |
return [ | |
'user_id' => factory(\App\User::class), // belongs to | |
'title' => $faker->sentence, |
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
Unix commands | |
========================== | |
1. find a file by name | |
- find / -name my.cnf | |
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
Z-KITBAG | |
----------------- | |
Z - zameeni nishan | |
K - khabar | |
I - irrada | |
T - tareeka | |
B - bandobast | |
A - administration | |
G - ghadi milao |
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
// https://stackoverflow.com/a/2594855 | |
SELECT name, | |
reg_no, | |
CLASS, | |
SECTION, | |
count(*) | |
FROM cps_student | |
GROUP BY name, | |
reg_no |
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
# The Best Medium-Hard Data Analyst SQL Interview Questions | |
By Zachary Thomas ([[email protected]](mailto:[email protected]), [Twitter](https://twitter.com/zach_i_thomas), [LinkedIn](https://www.linkedin.com/in/thomaszi/)) | |
**Tip: **See the Table of Contents (document outline) by hovering over the vertical line on the right side of the page | |
## Background & Motivation | |
> The first 70% of SQL is pretty straightforward but the remaining 30% can be pretty tricky. |
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
public function init() | |
{ | |
parent::init(); | |
Yii::$app->set('user', [ | |
'class' => 'yii\web\User', | |
'identityClass' => 'app\models\Editor', | |
'enableAutoLogin' => false, | |
'loginUrl' => ['yonetim/default/login'], | |
'identityCookie' => ['name' => 'editor', 'httpOnly' => 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
cps exam module:- | |
------------------------ | |
1. exam timing and questions have state, resume from where left off, | |
2. question and answers can be both text and image, | |
3. question has only a single answer, | |
4. question option 4, | |
5. student by registration id, | |
6. exam schedule by class/section/subject, |
NewerOlder