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
-ms-word-break: break-all; | |
word-break: break-all; | |
// Non standard for webkit | |
word-break: break-word; | |
-webkit-hyphens: auto; | |
-moz-hyphens: auto; | |
hyphens: auto; | |
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 is_touch_device() { | |
return !!('ontouchstart' in window) // works on most browsers | |
|| !!('onmsgesturechange' in window); // works on ie10 | |
}; |
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
_gaq.push(['_trackEvent', 'category', 'action', 'label', 'val']); |
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
window.onerror = function(msg, url, line) { | |
// You can view the information in an alert to see things working | |
// like so: | |
alert("Error: " + msg + "\nurl: " + url + "\nline #: " + line); | |
// TODO: Report this error via ajax so you can keep track | |
// of what pages have JS issues | |
var suppressErrorAlert = true; | |
// If you return true, then error alerts (like in older versions of |
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
document.body.scrollTop = document.documentElement.scrollTop = 0; |
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
define(['path/to/jquery.min'], function () { | |
return jQuery.noConflict(true); | |
}); |
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 preload(arrayOfImages) { | |
$(arrayOfImages).each(function(){ | |
(new Image()).src = this; | |
}); | |
} | |
// Usage: | |
preload([ | |
'img/imageName.jpg', |
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
git branch | grep -v "develop" | xargs git branch -D |
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
var seedNotes = dv.pages('"Private/Urgent"').file.filter(function(note){return note.name !== "_Index"}) | |
function getRandomInt(min, max) { | |
min = Math.ceil(min); | |
max = Math.floor(max); | |
return Math.floor(Math.random() * (max - min) + min); //The maximum is exclusive and the minimum is inclusive | |
} | |
var randomNoteIndex = getRandomInt(0, seedNotes.length) | |
var randomNote = seedNotes.filter(function(note,index){return index == randomNoteIndex}) |