🏳️🌈
- GitHub Staff
- http://digitarald.de
- @digitarald
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
class Pubsub | |
constructor: -> | |
@topics = [] | |
@scopes = [] | |
@methods = [] | |
acquire: (host) -> | |
@acquired = true | |
host.pubsub = @ |
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
javascript:(function(a,b){if(/\/$/.test(b))b+="manifest.webapp";var c=a.install(b);c.onsuccess=c.onerror=function(){if(c.error)alert(b+"/n"+c.error.name);else c.result.launch()}})(navigator.mozApps,(getSelection().toString()||location.href).trim()); |
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
{ | |
"name": "My App", | |
"description": "My elevator pitch goes here", | |
"launch_path": "/", | |
"icons": { | |
"128": "/img/icon-128.png" | |
}, | |
"developer": { | |
"name": "Your Name or Organization", | |
"url": "http: //your-homepage-here.org" |
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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
var target = 0; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; |
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
diff --git a/cache-then-network/sw.js b/cache-then-network/sw.js | |
index 9449f5f..8170159 100644 | |
--- a/cache-then-network/sw.js | |
+++ b/cache-then-network/sw.js | |
@@ -6,15 +6,12 @@ var cacheName = 'cache-then-network'; | |
self.addEventListener('install', function(ev) { | |
console.log('SW install event'); | |
- self.skipWaiting(); | |
- ev.waitUntil(self.clients.claim()); |
This file has been truncated, but you can view the full file.
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
28014 http request GET https://registry.npmjs.org/semver | |
28015 verbose request uri https://registry.npmjs.org/hosted-git-info | |
28016 verbose request no auth needed | |
28017 info attempt registry request try #1 at 1:30:45 PM | |
28018 verbose request using bearer token for auth | |
28019 verbose etag "CTVPC6MTOOUB33OPF9OBO9WB7" | |
28020 http request GET https://registry.npmjs.org/hosted-git-info | |
28021 verbose request uri https://registry.npmjs.org/validate-npm-package-license | |
28022 verbose request no auth needed | |
28023 info attempt registry request try #1 at 1:30:45 PM |
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
if ('MozActivity' in window) { | |
document.getElementById('my-file-input').addEventListener('click', function(evt) { | |
evt.preventDefault(); | |
var picking = new MozActivity({ | |
name: 'pick', | |
data: { | |
type: 'image/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
var selfReq = navigator.mozApps.getSelf(); | |
isMozRuntime = false; | |
selfReq.onsuccess = function() { | |
isMozRuntime = selfReq.result; | |
if (isMozRuntime) { | |
// Responsive action to mozilla apps runtime (force links in new window | |
respondToMozRuntime(); | |
} | |
}; | |
function respondToMozRuntime() { |
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
if ('MozActivity' in window) { // feature detection | |
// When getting elements, like document.getElementsByClassName('video-links') | |
// rather use event delegation, like | |
// `jQuery(document).on('click', 'video', fn) | |
document.getElementById('video-1').onclick = function(evt) { | |
evt.preventDefault(); // Prevent click behaviour | |
console.log("Launching Video!"); | |
var activity = new MozActivity({ |
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
/** | |
* Issue a register() call | |
* To register to listen for a notification, you simply call push.register | |
*/ | |
var pushReq = navigator.push.register(); | |
pushReq.onsuccess = function(e) { | |
alert('pushReq.onsuccess'); | |
var endpoint = pushReq.result; | |
// Store it |