This file contains hidden or 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
// Detecto si es un iPad o dispositivo con deteccion de movimiento | |
var isTouchable = ('ontouchstart' in window) || ('onmsgesturechange' in window); | |
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent); | |
var isOrientationDevice = (window.DeviceOrientationEvent != null) && (typeof(window.DeviceOrientationEvent) === 'object'); |
This file contains hidden or 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
$.fn.isOnScreen = function() { | |
var win = $(window); | |
var viewport = { | |
top : win.scrollTop(), | |
left : win.scrollLeft() | |
}; | |
viewport.right = viewport.left + win.width(); | |
viewport.bottom = viewport.top + win.height(); |
This file contains hidden or 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
var pass = Math.floor(Date.now() * Math.random()).toString(36); |
This file contains hidden or 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
// Disable Context Menu | |
document.oncontextmenu = function () { | |
return false | |
}; | |
// Disable dragging of HTML elements | |
document.ondragstart = function () { | |
return false | |
}; | |
This file contains hidden or 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 to generate percentual progress classes | |
* .p-1 1% -> p-100 100% | |
**/ | |
$step: 1; | |
$loops: round(100 / $step); | |
$increment: 360 / $loops; | |
$half: round($loops / 2); | |
@for $i from 1 through $loops { |
This file contains hidden or 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 getAgeFromBirthday() { | |
var month = document.getElementById('b-month').value; | |
var day = document.getElementById('b-day').value; | |
var year = document.getElementById('b-year').value; | |
var b_date = new Date(year, month, day); | |
if (b_date.getDate() != day || b_date.getMonth() != month || b_date.getFullYear() != year) { | |
alert('Please enter a valid date of birth'); |
This file contains hidden or 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
Array.prototype.unique = function() { | |
return this.filter(function (value, index, self) { | |
return self.indexOf(value) === index; | |
}); | |
} | |
/*****/ | |
var arr = ['a', 1, 'a', 2, '1'] | |
arr.unique(); // => ['a', 1, 2, '1'] |
This file contains hidden or 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
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); |
This file contains hidden or 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
@mixin no-selectable() | |
{ | |
-webkit-touch-callout: none; | |
-webkit-user-select: none; | |
-khtml-user-select: none; | |
-moz-user-select: none; | |
-ms-user-select: none; | |
user-select: none; | |
} |
This file contains hidden or 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
jQuery.fn.clog = function(msg) { | |
var txt = msg ? msg : ""; | |
if (console && typeof console.log != "undefined") { | |
console.log('%o ', this, txt); | |
} | |
return this; | |
} | |
/* | |
* use .clog() in the middle of your chain to make sure you have the | |
* proper object before you continue. it will log the current jquery |
OlderNewer