Wednesday, October 28, 2015

website is the lightbox effect

One of the most popular ways you can showcase photos on your website is the lightbox effect.
Well, we wanted to simplify the process, so we've written a little tool that makes adding the Fancybox lightbox script to your page a snap.  Thanks to cdnjs, you don't even have to worry about adding any files to your site.



 

Monday, October 26, 2015

How to check if string has at least one letter, number and special character in php

Lowercase character, Uppercase character, Digit, Symbol
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*(_|[^\w])).+$

A short explanation:

^ // the start of the string
(?=.*[a-z]) // use positive look ahead to see if at least one lower case letter exists
(?=.*[A-Z]) // use positive look ahead to see if at least one upper case letter exists
(?=.*\d) // use positive look ahead to see if at least one digit exists
(?=.*[_\W]) // use positive look ahead to see if at least one underscore or non-word character exists
.+ // gobble up the entire string
$ // the end of the string

Here is more explain of this type of password security in regex

Minimum 8 characters at least 1 Alphabet and 1 Number:
"^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$"
Minimum 8 characters at least 1 Alphabet, 1 Number and 1 Special Character:
"^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$"
Minimum 8 characters at least 1 Uppercase Alphabet, 1 Lowercase Alphabet and 1 Number:
"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$"
Minimum 8 characters at least 1 Uppercase Alphabet, 1 Lowercase Alphabet, 1 Number and 1 Special Character:
"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&])[A-Za-z\d$@$!%*?&]{8,}"
Minimum 8 and Maximum 10 characters at least 1 Uppercase Alphabet, 1 Lowercase Alphabet, 1 Number and 1 Special Character:
"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&])[A-Za-z\d$@$!%*?&]{8,10}"
 
 
I hope this will help you  

Monday, October 19, 2015

Get country by mobile no

Here I am going to tell you how can you get country by mobile no
sometime you have the mobile no with country code


    mobile
   971525478965
   919844005522
   45712345678
 
I am going to through each number in the database and find the country code from
the mobile number display the country code and the country using php.

 
 
 
 If you  like then share 

Thursday, October 8, 2015

Get selected value in dropdown list using JavaScript?

Get selected value in dropdown list using JavaScript?

<select id="ViewBy">
  <option value="1">Subjet1</option>
  <option value="2" selected="selected">Subject2</option>
  <option value="3">Subject3</option>
</select>



Running this code:

var e = document.getElementById("ViewBy");
var strUser = e.options[e.selectedIndex].value;

Would make strUser be 2.
If what you actually want is Subject2, then do this:

var e = document.getElementById("ViewBy");
var strUser = e.options[e.selectedIndex].text;

Which would make strUser be Subject2


--------------------------------------------------------------------------------------------

jQuery:

$("#elementId :selected").text() //the text content of the selected option
$("#elementId").val()            //the value of the selected option

------------------------------------------------------------------------------------------------
AngularJS

// html

<select ng-model="selectItem" ng-options="item as item.text for item in items">
</select>
<p>Text: {{selectItem.text}}</p>
<p>Value: {{selectItem.value}}</p>

// javascript
$scope.items = [{
  value: 'item_1_id',
  text: 'Item 1'
}, {
  value: 'item_2_id',
  text: 'Item 2'
}];

GitHub repository using Git Bash command

  To add a project to a GitHub repository using Git Bash command line, you can follow these steps: Create a new repository on GitHub by logg...