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 http = require('http'), | |
httpProxy = require('http-proxy'); | |
// | |
// Setup proxy server with forwarding | |
// | |
var options = { | |
router: { | |
'proxytest.randylubin.com': '127.0.0.1:7200', | |
'randylubin.com': '127.0.0.1:7200', |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Web Audio API Test</title> | |
<style>#data{ color: #ff0077; font-weight: bold;}</style> | |
</head> | |
<body> | |
<h1>Processing audio from Media Element Source</h1> | |
<h2>Works in Chrome, fails in Safari</h2> | |
<audio controls="controls"> |
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
exports[key] = value for key, value of { | |
run : run | |
document : document | |
parse : parse | |
resolveSource : resolveSource | |
version : version | |
defaults : defaults | |
languages : languages | |
} |
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
<!doctype html> | |
<script> | |
function pause() { | |
console.log('pause') | |
node.disconnect() | |
} | |
function play() { | |
console.log('play'); |
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
// Where native object is something like AudioContext, localStorage, XMLHttpRequest, etc.. | |
var | |
nObject = window.someNativeObject, | |
originalMethod = nObject.method; | |
nObject.method = function () { | |
// Do other things here, like track arguments | |
originalMethod.apply( nObject, arguments ); | |
} |
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 curry = require( 'curry' ); | |
var newFn = curry( [1,2,3], fn ); | |
newFn( 4 ); | |
function fn () { | |
Array.prototype.slice.call( arguments ).forEach(function (x) { | |
console.log( x ); | |
}); | |
// outputs 1, 2, 3, 4 | |
} |
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
/* | |
* testing page-mod's persistence with bfcache | |
*/ | |
require('sdk/page-mod').PageMod({ | |
include: '*', | |
contentScript: 'new ' + fn | |
}); | |
// Content script |
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
const { Bookmarks } = require('sdk/places/bookmarks'); | |
const { all } = require('sdk/core/promise'); | |
const { each } = require('sdk/util/array'); | |
var data = [ | |
{ | |
url: 'http://www.mozilla.org', | |
title: 'Mozilla Org Homepage'}, | |
{ | |
url: 'http://bugzilla.mozilla.org', |
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
const { Cc, Ci, Cu } = require('chrome'); | |
const FaviconService = Cc["@mozilla.org/browser/favicon-service;1"]. | |
getService(Ci.nsIFaviconService); | |
const IO = Cc["@mozilla.org/network/io-service;1"]. | |
getService(Ci.nsIIOService); | |
const asyncFavicons = FaviconService.QueryInterface(Ci.mozIAsyncFavicons); | |
let url = IO.newURI('http://www.mozilla.org', null, null); | |
// PRINT: URI: null len: 0 data: type: | |
asyncFavicons.getFaviconDataForPage(url, function (aURI, aDataLen, aData, aMimeType) { |
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
let { events } = require('sdk/content/events'); | |
let { on, emit, off, setListeners } = require('sdk/event/core'); | |
let { filter, pipe, map } = require('sdk/event/utils'); | |
let { create } = require('sdk/frame/utils'); | |
let { window } = require('sdk/addon/window'); | |
let view = create(window.document, { | |
nodeName: 'iframe', | |
type: 'content', | |
uri: 'http://mozilla.org', |
OlderNewer