I hereby claim:
- I am ryanhamley on github.
- I am rhamley (https://keybase.io/rhamley) on keybase.
- I have a public key ASCp8_FUT1irc025hMA6hOgjzH7e_Ljo8_P3xNbh-CmN0Ao
To claim this, I am signing this object:
| // How to add an SVG as a symbol layer's icon image: https://github.com/mapbox/mapbox-gl-js/issues/5529#issuecomment-340011876 | |
| // Also see here: https://stackoverflow.com/a/11765731/2748013 (we need the data url stuff for the image src) | |
| // NOTE: Importing SVGs requires an inline module loader such as https://github.com/webpack-contrib/svg-inline-loader | |
| import template from './templates/marker.svg'; | |
| const width = 20; | |
| const height = 40; | |
| const img = new Image(width, height); | |
| // map is your Mapbox GL map object |
I hereby claim:
To claim this, I am signing this object:
| var log_file = fs.createWriteStream(__dirname + '/debug.log', {flags : 'w'}); | |
| var log_stdout = process.stdout; | |
| console.log = function(d) { // | |
| log_file.write(util.format(d) + '\n'); | |
| log_stdout.write(util.format(d) + '\n'); | |
| }; |
| angular.module('managerApp') | |
| .directive('time', function () { | |
| return { | |
| restrict: 'A', | |
| require: 'ngModel', | |
| link: function postLink(scope, element, attrs, ngModelController) { | |
| //convert data from view format to model format | |
| ngModelController.$parsers.push(function(data) { | |
| if(window.ui.browser !== 'Chrome') { | |
| var amPM = data.substring(data.length-2, data.length); |
| /** | |
| * [verifyCardNumber implements the Luhn algorithm (http://en.wikipedia.org/wiki/Luhn_algorithm), which is a checksum algorithm to determine card validity. This implementation was developed by BrainJar (http://www.brainjar.com/js/validation/default2.asp)] | |
| * @param {[string]} _num [the credit card number in string format] | |
| * @return {Boolean} [true if valid, else false] | |
| */ | |
| function verifyCardNumber (_num) { | |
| var i, sum, digit, reverse, modified; | |
| // First, reverse the string and remove any non-numeric characters. | |
| reverse = ''; |
| //This function makes use of the getDigitAt() method which is found in a gist here: https://gist.github.com/ryanhamley/73140d5e9710a9a71fa0 | |
| function verifyCardType (_num) { | |
| //cast primitive number _num to a Number object to allow for using the getDigitAt() method | |
| var num = Number(_num); | |
| if (num.getDigitAt(0) === 4) { | |
| return 'Visa'; | |
| } | |
| switch (num.getDigitAt(0, 2)) { |
| angular.module('myApp') | |
| .directive('ignoreMouseWheel', function () { | |
| return { | |
| restrict: 'A', | |
| link: function (scope, element) { | |
| element.bind('mousewheel', function() { | |
| element[0].blur(); | |
| }); | |
| } | |
| }; |
| $http.get('/views/includes/datepicker.html', { | |
| cache: $templateCache | |
| }).success(function(template) { | |
| element.after($compile(template)(scope)); | |
| }); |