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
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
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
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 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 globals = { | |
isUndefined: function (o) { | |
return (o === undefined); | |
}, | |
isNull: function (o) { | |
return (o === null); | |
}, |
NewerOlder