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
| RewriteEngine On | |
| RewriteCond %{HTTPS} off | |
| RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L] | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteRule .* index.php/$0 [PT,L] |
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 | |
| /** | |
| * WordPress Query Comprehensive Reference | |
| * Compiled by luetkemj - luetkemj.com | |
| * | |
| * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
| * Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
| */ | |
| $args = array( |
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
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
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 | |
| CHtml::cssFile() => Html::cssFile() | |
| CHtml::scriptFile() => Html::jsFile() | |
| CHtml::link() => Html::a() | |
| CHtml::image() => Html::img() | |
| CHtml::submitButton() => Html::submitButton() | |
| // View | |
| $this->renderPartial() => $this->render() |
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
| Set up your local directory | |
| mkdir /path/to/your/project | |
| cd /path/to/your/project | |
| git init | |
| git remote add origin [email protected]:combro/misro-project.git | |
| Create your first file, commit, and push | |
| echo "Benyamin Sueb" >> contributors.txt |
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
| http://stackoverflow.com/questions/4181861/src-refspec-master-does-not-match-any-when-pushing-commits-in-git?answertab=votes#tab-top | |
| Maybe you just need to commit. I ran into this when I did: | |
| mkdir repo && cd repo | |
| git remote add origin /path/to/origin.git | |
| git add . | |
| Oops! Never committed! |
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
| # change path to your application's base path | |
| cd path/to/AppBasePath | |
| # show help information about Gii | |
| yii help gii | |
| # show help information about the model generator in Gii | |
| yii help gii/model | |
| # generate City model from city table |
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
| https://github.com/deerawan/clean-code/blob/master/README.md | |
| # Clean Code | |
| ## Conditionals | |
| ### Boolean Assignments | |
| ```javascript |
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 | |
| return array( | |
| /* ... */ | |
| 'components' => array( | |
| /* ... */ | |
| 'urlManager' => array( | |
| 'enablePrettyUrl' => true, | |
| 'rules' => require(__DIR__ . '/routes.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
| public function afterSave($insert, $changedAttributes) | |
| { | |
| if (($this->scenario == 'user' || $this->scenario == 'guest') && $this->isNewRecord) | |
| \Yii::$app->mailer->compose('new_comment', ['model' => $this]) | |
| ->setFrom([\Yii::$app->params['supportEmail'] => \Yii::$app->name . ' robot']) | |
| ->setTo(Email::getByGroup(Email::COMMENTS)) | |
| ->setSubject('Some subject') | |
| ->send(); | |
| parent::afterSave($insert, $changedAttributes); | |
| } |