Skip to content

Instantly share code, notes, and snippets.

Gurban Gurbanov BumbuKhan

Block or report user

Report or block BumbuKhan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
BumbuKhan / PostgreSQL
Created Apr 20, 2017
How to deploy database dump in PostgreSQL
View PostgreSQL
psql -U postgres dt < /path/to/dump.sql
BumbuKhan / yii2
Created Apr 13, 2017
Selectbox in gridview
View yii2
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'attribute' => 'user_id',
// 'filter' => array("1" => "open", "2" => "in progress", "3" => "closed")
'filter' => ArrayHelper::map(\app\models\User::find()->asArray()->all(), 'id', 'username')
BumbuKhan / Angular2
Last active Mar 30, 2017
Angular2 install
View Angular2
1) Install Node platform
2) Run 'npm install -g angular-cli'
'-g' stands for 'global'
'angular-cli' is a Command Line Interface which allows easly interact with angular while developing
3) Create your project by typing 'ng new <Your-project-name>'
4) Navigate to the folder <Your-project-name> and run 'ng serve'
it will build a project, run server on URL 'http://localhost:4200' and start watching for changes in code, once file is changed project will be rebuilt the project and browser will be automatically refreshed
BumbuKhan / PostgreSQL
Last active Mar 2, 2017
Work with tables in PostgreSQL
View PostgreSQL
List of available databases: \l
List of available tables: \dt
Choose table: \c <table_name>
Quit session: \q
BumbuKhan / jQuery
Created Feb 20, 2017
Event binding to dynamic DOM elements
View jQuery
$(document).on("click", "#test-element", function() {
alert("click bound to document listening for #test-element");
$('body').append('<div id="test-element">Click mee</div>');
BumbuKhan / Yii2
Created Feb 17, 2017
How to replace Yii::t('app', 'lang-key') to tag's data attribute (in notepad++)
View Yii2
Finf what: > ?<\?= ?Yii::t\('app',\ '(.*)'\);? ?\?>
Replace with: data-lang-key="\1">
<a href="javascript:void(0)" class="weather" title="Precipitation"><?= Yii::t('app', 'weather');?></a>
will be raplced to
<a href="javascript:void(0)" class="weather" title="Precipitation" data-lang-key="weather"></a>
BumbuKhan / Notepad++
Created Feb 17, 2017
How to use found by regex string in replacement
View Notepad++
Find: <\?= ?Yii::t\('app',\ '(.*)'\);? ?\?>
Replace with: \1
BumbuKhan / Yii2
Created Feb 16, 2017
How to pass variable to layout
View Yii2
// in controller
Yii::$app->view->params['message_to_layout'] = 'This message will be shown in layout';
// in layout (and in any view!)
View css
.clearfix::before, .clearfix::after {
content: "";
display: table;
.clearfix::after {
clear: both;
.clearfix {
@mixin border-radius-partial($radius, $part:null) {
@if ($part) {
-webkit-border-#{$part}-radius: $radius;
-moz-border-#{$part}-radius: $radius;
-ms-border-#{$part}-radius: $radius;
border-#{$part}-radius: $radius;
@else {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
You can’t perform that action at this time.