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
IMG_CNT=0; for URL in $(curl -s https://raw.githubusercontent.com/dconnolly/chromecast-backgrounds/master/README.md |awk -F'(' '{print $2}' | awk -F')' '{print $1}'); do IMG_CNT=$((IMG_CNT + 1)); curl -s "$URL" > $IMG_CNT"."${URL##*.} ; done |
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 deferredPromptEvent; | |
window.addEventListener('beforeinstallprompt', function(e) { | |
e.preventDefault(); | |
deferredPromptEvent = e; | |
return false; | |
}); | |
// and in the moment your condition is fulfilled | |
// check if the prompt had been triggered |
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 cacheName = 'v1', | |
checkinDataRegex = /applicable\?pnr=([a-zA-Z0-9]+)&lastname=([a-zA-Z]+)/ | |
ticketRegex = /image\/pnr\/([a-zA-Z0-9]+)\/lastname\/([a-zA-Z]+)\/ticket\/([0-9]+)/; | |
self.addEventListener('fetch', function(event) { | |
var request = event.request, | |
matchCheckin = checkinDataRegex.exec(request.url); | |
if (matchCheckin) { | |
// Use regex capturing to grab only the bit of the URL | |
// that we care about (in this case the checkinID) |
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 _isEmpty = function(obj) { | |
if ('undefined' !== Object.keys) { | |
return (0 === Object.keys(obj).length); | |
} | |
for(var prop in obj) { | |
if(obj.hasOwnProperty(prop)) { | |
return false; | |
} | |
} | |
return true; |
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() { | |
var raf = window.RequestAnimationFrame || | |
window.mozRequestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.msRequestAnimationFrame; | |
// defer loading of all app relevant javascript | |
// and non criticial CSS | |
function deferLoad() { | |
// JS |
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
<section class="page" id="dashboard"> | |
<header> | |
<slider-element name="dashboard" display="all"></slider-element> | |
</header> | |
<div class="contents"> | |
<ul class="collection"> | |
<li><a href="#flightdetails">Journey details</a></li> | |
<li><a href="#explore">Explore destination</a></li> | |
<li><checkin-element></checkin-element></li> | |
</ul> |