Bin e padrões para validação de cartão de crédito.
| Bandeira | Começa com | Máximo de número | Máximo de número cvc |
|---|---|---|---|
| Visa | 4 | 13,16 | 3 |
| Mastercard | 5 | 16 | 3 |
| function slugify(text) | |
| { | |
| return text.toString().toLowerCase() | |
| .replace(/\s+/g, '-') // Replace spaces with - | |
| .replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
| .replace(/\-\-+/g, '-') // Replace multiple - with single - | |
| .replace(/^-+/, '') // Trim - from start of text | |
| .replace(/-+$/, ''); // Trim - from end of text | |
| } |
| <?php | |
| use Doctrine\ORM\Mapping as ORM; | |
| use Doctrine\Common\Collections\ArrayCollection; | |
| /** | |
| * @ORM\Entity() | |
| * @ORM\Table(name="user") | |
| */ | |
| class User |
| /** | |
| * | |
| * Javascript color conversion | |
| * http://www.webtoolkit.info/javascript-color-conversion.html | |
| * | |
| **/ | |
| function HSV(h, s, v) { | |
| if (h <= 0) { h = 0; } | |
| if (s <= 0) { s = 0; } |
| import nme.Assets; | |
| import nme.display.Shape; | |
| import nme.display.Sprite; | |
| import format.SVG; | |
| class SVGExample extends Sprite | |
| { | |
| var svg:SVG; | |
| var shape:Shape; |
| angular.module('ymusica').controller('AlbumSearch', ['$scope', 'Albums', 'Artists', '$q', function($scope, albums, artists, $q) { | |
| $scope.albums = []; | |
| $scope.artists = []; | |
| var terms = new Rx.Subject(); | |
| $scope.searchMusic = terms.onNext.bind(terms); | |
| terms.sample(250) |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>| var foo = require("../../../lib/foo"); | |
| var bar = require("../../../lib/bar"); | |
| var baz = require("../../../lib/baz"); | |
| var quux = require("../../../lib/quux"); |