Category archive

web development

General Posting

82 articles

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

Drupal

drupal clean URLs not working? with tilde sign

If your site is developed in Drupal and your URL looks like this: If your site URL looks like this: http://[domain name OR IP Address]/~[accountname]/anyFolder/ Example http://example.com/~xyzaccount/somefolder/ http://xxx.xxx.xxx.xxx/~xyzaccount/somefolder/ Then you need to set RewriteBase!in your .htaccess file that

Aug 8, 2015

Read article

htaccess Setting

Force HTTPS url with .htaccess

RewriteCond %{HTTPS} off # First rewrite to HTTPS: # Don’t put www. here. If it is already there it will be included, if not # the subsequent rule will catch it. RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # Now, rewrite any request to the wrong domain to use www. RewriteCond %{HTTP_HOST} !^www\. Rewrit

Jul 30, 2015

Read article

ffmpeg

create high quality video using ffmpeg

You can use the open source ffmpeg program to convert a media file from low quality to high quality format [shellprompt]# /fullpath/to/ffmpeg/ffmpeg -i source.mp4 -c:v libx264 -crf 19 destinationfile.flv OR [shellprompt]# /fullpath/to/ffmpeg/ffmpeg -i source.mp4 -c:v libx264 -ar 22050 -crf 28 destinationfile.flv Parame

Nov 23, 2013

Read article

ffmpeg

convert video from one format to another using ffmpeg

You can use the open source ffmpeg program to convert a media file from one format to another. Below is an exmple: [shellprompt]# /fullpath/to/ffmpeglibrary/ffmpeg -i InputFile.FLV OutputFile.mp3 There are various other options you can use to specify the attribute of the output file. Here are few of the examples code h

Nov 23, 2013

Read article