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
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
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">
Example:
<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
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
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
BumbuKhan / Angular2
Last active Mar 30, 2017
Angular2 install
View Angular2
HOW TO INSTALL 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
BumbuKhan / yii2
Created Apr 13, 2017
Selectbox in gridview
View yii2
GridView::widget([
'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
BumbuKhan / PostgreSQL
Created Apr 20, 2017
How to deploy database dump in PostgreSQL
View PostgreSQL
psql -U postgres dt < /path/to/dump.sql
@BumbuKhan
BumbuKhan / PostgreSQL
Created Apr 20, 2017
How to view command line history, bash?
@BumbuKhan
BumbuKhan / PosgreSQL
Created Apr 21, 2017
How to create extension for table
View PosgreSQL
CREATE EXTENSION citext; -- to create
ALTER TABLE <table name>
ALTER COLUMN <column_name> TYPE citext; -- to apply
@BumbuKhan
BumbuKhan / Cordova
Created Jun 27, 2017
Angular-cordova routing cure
View Cordova
<script>
var baseHref = window.location.href.split('/');
baseHref.pop();
document.write('<base href="' + baseHref.join('/') + '/" />');
</script>
You can’t perform that action at this time.