forked from Experience-Monks/devtool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
223 additions
and
36 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ node_modules | |
*.log | ||
.DS_Store | ||
bundle.js | ||
example/streetview.png |
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// debugging an http server in DevTools! | ||
var http = require('http'); | ||
|
||
var server = http.createServer(function (req, res) { | ||
console.log('Requesting', req.url); | ||
if (req.url === '/') { | ||
res.end('Hello, world!'); | ||
} else { | ||
res.statusCode = 404; | ||
res.end('404 not found =('); | ||
} | ||
}).listen(8080, function () { | ||
console.log('Listening on http://localhost:8080/'); | ||
}); | ||
|
||
window.onbeforeunload = function () { | ||
server.close(); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
var get = require('simple-get'); | ||
var concat = require('concat-stream'); | ||
|
||
console.log('Requesting google.com'); | ||
get('http://google.com/', function (err, res) { | ||
if (err) throw err; | ||
res.pipe(concat(function (body) { | ||
console.log('Total bytes:', body.toString().length); | ||
if (process.env.NODE_ENV !== 'development') window.close(); | ||
})); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- A custom HTML index for the street view demo. --> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>streetview</title> | ||
<script src="https://maps.googleapis.com/maps/api/js?v=3.21"></script> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
var awesome = require('awesome-streetview'); | ||
var render = require('google-panorama-equirectangular'); | ||
var toBuffer = require('electron-canvas-to-buffer'); | ||
var googlePano = require('google-panorama-by-location/browser'); | ||
|
||
googlePano(awesome(), function (err, result) { | ||
if (err) throw err; | ||
render(result.id, { | ||
tiles: result.tiles, | ||
crossOrigin: 'Anonymous', | ||
zoom: 1 | ||
}).on('complete', function (canvas) { | ||
var buffer = toBuffer(canvas, 'image/png'); | ||
process.stdout.write(buffer); | ||
window.close(); | ||
}); | ||
}); |
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
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
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
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
Oops, something went wrong.