Skip to content

Instantly share code, notes, and snippets.

@aessam
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save aessam/9152198 to your computer and use it in GitHub Desktop.

Select an option

Save aessam/9152198 to your computer and use it in GitHub Desktop.
Share your screen to local network, it can be helpful in cases of meetings and you don't have projector, be creative and use it as much.
var imgStr = "";
setInterval(function(){
// Make sure to change the command based on the OS you are using.
require('child_process').spawn('screencapture', ['-C', '-x','cme.png']).on('close', function (code) {
imgStr = require("fs").readFileSync('cme.png','base64');
});
},1000);
require("http").createServer(function(req,res){
res.end('<meta http-equiv="refresh" content="1"> <img src="data:image/png;base64,' + imgStr + '" style="height: 100%;">/');
}).listen(8080);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment