This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GetCreditCardTypeByNumber(ccnumber) { | |
var cc = (ccnumber + '').replace(/\s/g, ''); //remove space | |
if ((/^(34|37)/).test(cc) && cc.length == 15) { | |
return 'AMEX'; //AMEX begins with 34 or 37, and length is 15. | |
} else if ((/^(51|52|53|54|55)/).test(cc) && cc.length == 16) { | |
return 'MasterCard'; //MasterCard beigins with 51-55, and length is 16. | |
} else if ((/^(4)/).test(cc) && (cc.length == 13 || cc.length == 16)) { | |
return 'Visa'; //VISA begins with 4, and length is 13 or 16. | |
} else if ((/^(300|301|302|303|304|305|36|38)/).test(cc) && cc.length == 14) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
An attempt at fixing the dreaded iOS orientationchange zoom bug http://adactio.com/journal/5088/. Seems to work! | |
Authored by @scottjehl | |
MIT License. | |
*/ | |
(function(w){ | |
var doc = w.document; | |
if( !doc.querySelectorAll ){ return; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-webkit-transition: all 300ms cubic-bezier(0.26, 0.86, 0.44, 0.985); | |
-moz-transition: all 300ms cubic-bezier(0.26, 0.86, 0.44, 0.985); | |
-ms-transition: all 300ms cubic-bezier(0.26, 0.86, 0.44, 0.985); | |
-o-transition: all 300ms cubic-bezier(0.26, 0.86, 0.44, 0.985); | |
transition: all 300ms cubic-bezier(0.26, 0.86, 0.44, 0.985); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Grep for the phrase 'TODO' in SCSS files (simply omit everything | |
# after the last star to search all file types. The 'j' option stops | |
# the cursor from automatically jumping to the first instance. | |
:vimgrep TODO/j **/*.scss | |
# Open a pane showing all instances. | |
:cw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From http://blog.hull.io/post/46243434040/introducing-sass-getunicode | |
'☃'.charCodeAt(0).toString(16); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function PhoneInputDirective( | |
$filter, $browser, $timeout | |
) { | |
'ngInject'; | |
const directive = { | |
restrict: 'A', | |
scope: { | |
phoneInput: '=', | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setup GitHub issue labels script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Step 1. | |
// this returns some useful information which will help you fill out the next command. | |
// look for the line that begins with "remote.origin.url". | |
$ git config -l | |
// Step 2. | |
// use the information from step one to replace 'your_username' and 'your_project'. | |
$ git config remote.origin.url git@github.com:your_username/your_project.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<iframe style="width: 100%; height: 600px" src="http://embed.plnkr.co/GvOO1itX8MG7zJLywSN8" frameborder="0" allowfullscren="allowfullscren"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Normalized hide address bar for iOS & Android | |
* (c) Scott Jehl, scottjehl.com | |
* MIT License | |
*/ | |
(function( win ){ | |
var doc = win.document; | |
// If there's a hash, or addEventListener is undefined, stop here | |
if( !location.hash && win.addEventListener ){ |
OlderNewer