Monday, November 20, 2017

Change an HTML5 input's placeholder color with CSS

There are three different implementations: pseudo-elements, pseudo-classes, and nothing.
  • WebKit, Blink (Safari, Google Chrome, Opera 15+) and Microsoft Edge are using a pseudo-element: ::-webkit-input-placeholder
  • Mozilla Firefox 4 to 18 is using a pseudo-class: :-moz-placeholder (one colon). 
  • Mozilla Firefox 19+ is using a pseudo-element: ::-moz-placeholder, but the old selector will still work for a while. 
  • Internet Explorer 10 and 11 are using a pseudo-class: :-ms-input-placeholder
Internet Explorer 9 and lower does not support the placeholder attribute at all, while Opera 12 and lower do not support any CSS selector for placeholders.
The discussion about the best implementation is still going on. Note the pseudo-elements act like real elements in the Shadow DOM. A padding on an input will not get the same background color as the pseudo-element.

So we need separate rules for each browser. Otherwise the whole group would be ignored by all browsers.

::-webkit-input-placeholder { /* WebKit, Blink, Edge */
    color:    #909;
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
   color:    #909;
   opacity:  1;
::-moz-placeholder { /* Mozilla Firefox 19+ */
   color:    #909;
   opacity:  1;
:-ms-input-placeholder { /* Internet Explorer 10-11 */
   color:    #909;
::-ms-input-placeholder { /* Microsoft Edge */
   color:    #909;
<input placeholder="php999 is great!">
Read more....

Wednesday, December 16, 2015

Edit an incorrect commit message in Git

Edit an incorrect commit message in Git

Amending the commit message

git commit --amend
Will open your editor, allowing you to change the commit message of the most recent commit. Additionally, you can set the commit message directly in the command line with:

git commit --amend -m "New commit message"


Make sure you don't have any working copy changes staged before doing this or they will get committed too. (Unstaged changes will not get committed.)

Changing the message of a commit that you've already pushed to your remote branch

If you've already pushed your commit up to your remote branch, then you'll need to force push the commit with

git push <remote> <branch> --force
# Or
git push <remote> <branch> -f
Warning: force-pushing will overwrite the remote branch with the state of your local one. If there are commits on the remote branch that you don't have in your local branch, you will lose those commits.
Warning: be cautious about amending commits that you have already shared with other people. Amending commits essentially rewrites them to have different SHA IDs, which poses a problem if other people have copies of the old commit that you've rewritten. Anyone who has a copy of the old commit will need to re-synchronize their work with your newly re-written commit, which can sometimes be difficult, so make sure you coordinate with others when attempting to rewrite shared commit history, or just avoid rewriting shared commits altogether.


Read more....

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.

Read more....

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 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:
Minimum 8 characters at least 1 Alphabet, 1 Number and 1 Special Character:
Minimum 8 characters at least 1 Uppercase Alphabet, 1 Lowercase Alphabet and 1 Number:
Minimum 8 characters at least 1 Uppercase Alphabet, 1 Lowercase Alphabet, 1 Number and 1 Special Character:
Minimum 8 and Maximum 10 characters at least 1 Uppercase Alphabet, 1 Lowercase Alphabet, 1 Number and 1 Special Character:
I hope this will help you  
Read more....

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

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 
Read more....

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>

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



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


// html

<select ng-model="selectItem" ng-options="item as item.text for item in items">
<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'
Read more....

Sunday, September 20, 2015

Interactive Graph Analysis and Visualization

Best Graph Library :)
  • SocialCompare has an extensive list of libraries, and the "Node / edge graph" line will filter for graph visualization ones.
  • has evaluated many libraries, including node/graph ones. Unfortunately there's no direct link so you'll have to filter for "graph":
Here's a list of similar projects (some have been already mentioned here):

Pure JavaScript Libraries

  • vis.js supports many types of network/edge graphs, plus timelines and 2D/3D charts. Auto-layout, auto-clustering, springy physics engine, mobile-friendly, keyboard navigation, hierarchical layout, animation etc. MIT licensed and developed by a Dutch firm specializing in research on self-organizing networks.
  • Cytoscape.js - interactive graph analysis and visualization with mobile support, following jQuery conventions. Funded via NIH grants and developed by by @maxkfranz (see his answer below) with help from several universities and other organizations.
  • The JavaScript InfoVis Toolkit - Jit, an interactive, multi-purpose graph drawing and layout framework. See for example the Hyperbolic Tree. Built by Twitter dataviz architect Nicolas Garcia Belmonte and bought by Sencha in 2010.
  • D3.js Powerful multi-purpose JS visualization library, the successor of Protovis. See the force-directed graph example, and other graph examples in the gallery.
  • Plotly's JS visualization library uses D3.js with JS, Python, R, and MATLAB bindings. See a nexworkx example in IPython here, human interaction example here, and JS Embed API.
  • sigma.js Lightweight but powerful library for drawing graphs
  • jsPlumb jQuery plug-in for creating interactive connected graphs
  • Springy - a force-directed graph layout algorithm
  • Processing.js Javascript port of the Processing library by John Resig
  • JS Graph It - drag'n'drop boxes connected by straight lines. Minimal auto-layout of the lines.
  • RaphaelJS's Graffle - interactive graph example of a generic multi-purpose vector drawing library. RaphaelJS can't layout nodes automatically; you'll need another library for that.
  • JointJS Core - David Durman's MPL-licensed open source diagramming library. It can be used to create either static diagrams or fully interactive diagramming tools and application builders. Works in browsers supporting SVG. Layout algorithms not-included in the core package
  • HighCharts - Highcharts is a charting library written in pure JavaScript. it is based on SVG, but unlike many others, it also supports older browsers who use VML to render vector graphic. It is licenced under CC BY-NC 3.0

Commercial libraries

Abandoned libraries

  • Cytoscape Web Embeddable JS Network viewer (no new features planned; succeeded by Cytoscape.js)
  • Canviz JS renderer for Graphviz graphs. Abandoned in Sep 2013.
  • arbor.js Sophisticated graphing with nice physics and eye-candy. Abandoned in May 2012. Several semi-maintained forks exist.
  • jssvggraph "The simplest possible force directed graph layout algorithm implemented as a Javascript library that uses SVG objects". Abandoned in 2012.
  • jsdot Client side graph drawing application. Abandoned in 2011.
  • Protovis Graphical Toolkit for Visualization (JavaScript). Replaced by d3.
  • Moo Wheel Interactive JS representation for connections and relations (2008)
  • JSViz 2007-era graph visualization script
  • dagre Graph layout for JavaScript

Non-Javascript Libraries

  • Graphviz Sophisticated graph visualization language
  • Flare Beautiful and powerful Flash based graph drawing
  • NodeBox Python Graph Visualization
Read more....
Related Posts Plugin for WordPress, Blogger...