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
/* SOME_MODULE.js */ | |
var masala = require('masala'); | |
// The default arguments have a lot of unbound parameters (something like 12) | |
// They specify a myriad of arguments from invocation-specific parameters | |
// to general options that should be mostly shared between all invocations | |
var defaultArguments = { ... }; | |
function genericFunction (options, callback) { ... } |
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
// Dash live profile: | |
{ | |
"duration": 60200, | |
"poster_sources": [ | |
{ | |
"src": "http://brightcove.vo.lowlight.local/ll/media/file/3303963094001/3303963094001_30328785791202_30328762662001-vs.jpg?pubId=3303963094001" | |
}, | |
{ | |
"src": "https://sadmin.brightcove.com/ll/media/file/3303963094001/3303963094001_30328785791202_30328762662001-vs.jpg?pubId=3303963094001" |
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
player.src({ | |
"src": "movie.mpd", | |
"type":"application/dash+xml", | |
"keySystemOptions": [ | |
{ | |
"name": "com.widevine.alpha", | |
"options": { | |
"licenseUrl": "https://example.com/license" | |
} | |
} |
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
videojs.players.vjs_video_3.player.src({ | |
src: 'http://some.com/manifest.mpd', | |
type: 'application/dash+xml' | |
}); |
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 asymHumanoidBodyParts = [["head", 3], | |
["left-eye", 1], | |
["left-ear", 1], | |
["mouth", 1], | |
["nose", 1], | |
["neck", 2], | |
["left-shoulder", 3], | |
["left-upper-arm", 3], | |
["chest", 10], | |
["back", 10], |
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(global) { // global is == to window | |
"use strict"; // Tells JS engine to warn you about silly things you've done | |
var myVariable = 10; | |
function internalFunction(val) { | |
return myVariable * val; | |
} | |
global.externalFunction = function(num){ |
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
<html> | |
<head> | |
<title>IIFE App</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
</head> | |
<body> | |
<input type="button" id="idButton" value="Click Me!"> | |
<div id="idOutput"></div> | |
<script type="text/javascript" src="LoadIIFE.js"></script> | |
</body> |
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
<html> | |
<head> | |
<title>IIFE App</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
</head> | |
<body> | |
<input type="button" id="idButton" value="Click Me!"> | |
<div id="idOutput"></div> | |
<script type="text/javascript" src="LoadIIFE.js"></script> | |
</body> |
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 parent = {a:2, b:33}; | |
var ChildMaker = function(){}; | |
ChildMaker.prototype = parent; | |
var child = new ChildMaker(); | |
parent.c = 2; | |
child.c; // 2 |
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 require = function(require){ | |
var NM = function(){ | |
var src = process.binding('natives'); | |
src = Object.keys(src).reduce(function(ret, key){ | |
ret[key] = src[key]; | |
return ret; | |
}, {}); | |
var NM = function NativeModule(id) { | |
this.filename = id + '.js'; |