Skip to content

Instantly share code, notes, and snippets.

View baskeboler's full-sized avatar
🏠
Working from home

Victor Gil baskeboler

🏠
Working from home
View GitHub Profile
@baskeboler
baskeboler / isIPhone6PlusOrHigher.js
Last active December 27, 2016 05:29
checking if we are on iphone 6 plus or higher with cordova device.model
var modelString = device.model;
var modelRegex = /\d+/g;
var isIPhone6PlusOrHigher = false;
var match = modelString.match(modelRegex);
if (match != null) {
var major = match[0], minor = match[1];
if (major == 7) {
if (minor != 2) {
// iphone 6 plus
isIPhone6PlusOrHigher = true;
@baskeboler
baskeboler / inheritance.js
Last active August 29, 2015 14:22
Javascript inheritance and polymorphism
var Person = function (name) {
this.name = name;
}
Person.prototype = {
sayHi: function() {
console.log('Hi, my name is ' + this.name);
},
parentClassMethod: function() {
console.log('Method from Person class called on ' + this.name);
@baskeboler
baskeboler / controller.js
Created May 15, 2015 10:27
angular controller
(function() {
'use strict';
angular.module('App').controller('Ctrl', Ctrl);
Ctrl.$inject = [];
function Ctrl() {
var vm = this;
}
})();