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
Drop in replace functions for setTimeout() & setInterval() that | |
make use of requestAnimationFrame() for performance where available |
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
""" | |
Django's SMTP EmailBackend doesn't support an SMTP_SSL connection necessary to interact with Amazon SES's newly announced SMTP server. We need to write a custom EmailBackend overriding the default EMailBackend's open(). Thanks to https://github.com/bancek/django-smtp-ssl for the example. | |
""" | |
--- settings.py | |
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' | |
EMAIL_HOST = 'email-smtp.us-east-1.amazonaws.com' | |
EMAIL_PORT = 465 | |
EMAIL_HOST_USER = 'username' |
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
sudo cp nginx /etc/init.d/ | |
sudo update-rc.d nginx defaults | |
sudo chmod +x /etc/init.d/nginx | |
/etc/init.d/nginx start |
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
import code; code.interact(local=dict(globals(), **locals())) |
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 delta; | |
dragThreshold = 0.15;// "percentage" to drag before engaging | |
dragStart = null; // used to determine touch / drag distance | |
percentage = 0, | |
target, | |
previousTarget; | |
function touchStart(event) { | |
if (dragStart !== null) { 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
var urlToCheck = 'https://deanhume.github.io/beer' + createStyleUrl(styleId, pageId, false); | |
/** | |
* Display the offline notification. | |
* @return {void} | |
**/ | |
function showOfflineNotification() { | |
// return if there is no service worker | |
if (!'serviceWorker' in navigator) { | |
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
/** | |
* Helper method to determine the filename from the URL | |
* @param {url} the path to match | |
* @return {String} the path for caching | |
**/ | |
function getFilenameFromUrl(url){ | |
var path = url.substring(path.lastIndexOf("/")+ 1); | |
return (path.match(/[^.]+(\.[^?#]+)?/) || [])[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
var delta; | |
var currentSlideIndex = 0; | |
function elementScroll (e) { | |
// --- Scrolling up --- | |
if (e.originalEvent.detail < 0 || e.originalEvent.wheelDelta > 0) { | |
delta--; |