JustAskVin Insights

Ideas for leading and building technology well.

Practical writing on delivery, architecture, CMS migrations, digital growth, and the decisions that shape strong web experiences.

Latest

Page 8 of recent writing

All insights home →

linux

How to create tar archive file in linux

The below command will create a tar archive file whatevername_yougive.tar for a directory /path/of/directory/to/archive in current working directory. See the example below. tar cvf whatevername_yougive.tar /path/of/directory/to/archive The options detail are explained as below c – Creates a new .tar archive file. v – V

Jan 19, 2018

Read article

CMS

How to wrap data column in Gridview widget in yii or yii2 framework

The column which you want to wrap should be added the property called “contentOptions” where you can apply the css property to suits your needs and requirements as below. [ ‘attribute’ => ‘column name’, ‘format’ => ‘html’, ‘noWrap’ => false, ‘mergeHeader’=>true, ‘contentOptions’ => [‘style’ => ‘width: 50%; overflow: sc

Nov 20, 2017

Read article

MVC

How to get raw sql query in yii or yii2 framework

If you have used the query builder in yii 2.0.8 framework then to get the raw sql generated use the below statement. $query->andFilterWhere([‘like’, ‘username’, $this->username]) ->andFilterWhere([‘like’, ’email_id’, $this->email]) ->andFilterWhere([‘registration_date’ => $this->register_date]); // This is echo the raw

Nov 15, 2017

Read article

Laravel

how to get sql query from facade DB::table in laravel 5

Normally we fetch the data as below $dataresult = DB::table(‘sometable’) ->select(‘sometable.column1’, ‘sometable.column2’, ‘sometable.column3’, ‘sometable.column4’, ‘sometable.column5’) ->get(); Now if we want to get the actaul query from $dataresult using $dataresult->toSql(); // it will not work The solution for thi

Oct 7, 2017

Read article

linux

How to Change Timezone in CentOS

You check the time from the command line (run date), and find that the timezone is set to UTC or some other timezone. How do you get this changed? To change this you have to have root access to the server. There are a series of time zone files located at /usr/share/zoneinfo. Select the appropriate […]

Feb 2, 2016

Read article

linux

Timezone issue with cron

If your cron job timing does’t match with the server time zone for example. You have set the cron to run at 12:30 PM, but when you see the cron log the time show say 3:40 PM. So to run your cron job as per your time zone Say if you are in India, your […]

Feb 2, 2016

Read article

HTML

validate mobile number on keypress using jquery

How to validate and restrict unwanted character for mobile or phone number field using jquery $(document).ready(function () { $(‘#mobile’).keyup(function () { var $th = $(this); $th.val($th.val().replace(/[^0-9]/g, function (str) { return ”; })); }); });

Aug 8, 2015

Read article

javascript

validate name on keypress using jquery

How to validate and restrict unwanted character for name field using jquery $(document).ready(function () { $(‘#name’).keyup(function () { var $th = $(this); $th.val($th.val().replace(/[^a-zA-Z0-9 \`]/g, function (str) { return ”; })); }); });

Aug 8, 2015

Read article