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 9 of recent writing

All insights home →

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

ffmpeg

create video thumbnail using ffmpeg

You can use the open source ffmpeg program to extract a frame to use as a thumbnail for a video. Below is an exmple: [shellprompt]# /fullpath/to/ffmpeglibrary/ffmpeg -i InputFile.FLV -vframes 1 -an -s 400×222 -ss 30 OutputFile.jpg -i = Inputfile name -vframes 1 = Output one frame -an = Disable audio -s 400×222 = Output

Nov 23, 2013

Read article

CMS

Set widget label from action file in symfony 1.4

In Action File ========================================================== $this->form = new youFormclassname(); To set individual Label $this->form->getWidget(‘widgetname’)->setLabel(‘widget Custom label’); To set multiple field label $this->form->getWidgetSchema()->setLabels(array( ‘field_name_1’ => ‘Field 1 Custom La

Aug 31, 2012

Read article

HTML

Replace any text from html text by tag name in php

function replace_tag_text($tagName,$subjectStr,$replaceStr) { $tagName = preg_quote($tagName); preg_match_all(‘{<‘.$tagName.'[^>]*>(.*?)</’.$tagName.’>}’,$subjectStr,$matches,PREG_PATTERN_ORDER); $result = str_replace($matches[1],$replaceStr,$subjectStr); return $result; } Usage : Say for Example $ActualStr : ‘<div><sp

Aug 2, 2012

Read article