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 globals = { | |
isUndefined: function (o) { | |
return (o === undefined); | |
}, | |
isNull: function (o) { | |
return (o === null); | |
}, |
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 Person(name){ | |
this.name = name; | |
} | |
Person.prototype.say = function(){ | |
console.log("hi"); | |
} | |
function CTO(){ | |
Person.call(this,"dd") |
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 arr = [1,2,3,4]; | |
function swapValues(){ | |
return [].slice.call(arguments).reduce(function(a, b) {return a.concat(b);}).reverse(); | |
} | |
arr = swapValues(arr,5); | |
console.log(arr) |
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 User(first, last){ | |
if ( !(this instanceof User) ) | |
return new User(first, last); | |
this.name = first + " " + last; | |
} | |
var name = "Resig"; | |
var user = User("John", name); | |
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 qs(name) { | |
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | |
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), | |
results = regex.exec(location.search); | |
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
} |
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 Transcoder = require('stream-transcoder'); | |
module['exports'] = function transcodeVideoStream (hook) { | |
var readStream = hook.open(hook.params.video); | |
hook.debug('Opening read stream to video'); | |
hook.res.writeHead(200, { | |
"Content-Type": "video/mp4" | |
}); |
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
//Channel.js | |
Sdk.Channel = function (json) { | |
var __propMap = { | |
"id": {"prop": "channelId"}, | |
"name": {"prop": "name"}, | |
"watermarkImages": {"prop": "_watermarkImages", "class": Sdk.Image}, | |
"currentProgram": {"prop": "currentProgram", "class": Sdk.Program}, | |
"officialUrl": {"prop": "officialUrl"}, | |
"callSign": {"prop": "callSign"}, | |
"preRollUrl": {"prop": "preRollUrl"}, |
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 userProto = { | |
login: () => console.log('hello') | |
}; | |
var User = (json) => | |
Object.assign(Object.create(userProto),jsonFromServer,{ | |
}); |
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
'use strict'; | |
angular.module('wpclp.cp').directive('cpMultiShareManager', function() { | |
return { | |
restrict: 'E', | |
replace: true, | |
scope: true, | |
link: function(scope, el, attr) { | |
}, |
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
/** | |
* The base implementation of `_.flatten` with added support for restricting | |
* flattening and specifying the start index. | |
* | |
* @private | |
* @param {Array} array The array to flatten. | |
* @param {boolean} [isDeep] Specify a deep flatten. | |
* @param {boolean} [isStrict] Restrict flattening to arrays-like objects. | |
* @returns {Array} Returns the new flattened array. | |
*/ |
OlderNewer