- We are writing a digital textbook-reading app.
- Most of the time you have a "basic" license for your textbook, but one (and only one) of your computers can request an "enhanced" license.
- You can only print from the computer with the enhanced license.
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
| module.exports = function (app, bundle) { | |
| app.get('/multi/:bundle', get(bundle)); | |
| }; | |
| function get(something){ | |
| //Is 'something' the :bundle or the (app, bundle) parameter? | |
| } |
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 fetchReadme(bundleName, preferredVersions){ | |
| sandbox.bundle(bundleName, preferredVersions) | |
| .on('bundleEnd', function(html){ | |
| //The HTML isn't what I wanted here, I want the full package.json, | |
| //which Browserify CDN is already supplying. | |
| //I'm having trouble tracking down where in browser-module-sandbox or browser-module-cache this is stored, if at all. | |
| //Tips? | |
| }) |
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 fetchBundle(bundleName, preferredVersions, cb){ | |
| var er = sandbox.bundle(bundleName, null) | |
| sandbox.on('bundleEnd', function(html){ | |
| //Just to test, this IS returning bundle HTML, so I seem to be calling sandbox.bundle() correctly. | |
| }) |
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
| fs.createServer(function(req, res){ | |
| var extensionTrumpet = trumpet(); | |
| extensionTrumpet.selectAll('#frameInitScript', function(elem){ | |
| var writeOutStream = elem.createWriteStream(); | |
| for(var i = 0; i < extensions.length; i++){ | |
| fs.createReadStream(__dirname + '/../site/blocks/'+extensions[i]+'.js').pipe(writeOutStream); | |
| } | |
| }); |
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
| ///Wavy cloud generator | |
| for(var x = -20; x < 20; x++){ | |
| for(var z = -20; z < 20; z++){ | |
| setBlock([x, Math.sin(x*0.1)+Math.cos(z*0.1)+50, z], 3); | |
| } | |
| } | |
| ///Wavy cloud generator2 | |
| for(var x = -20; x < 20; x++){ | |
| for(var z = -20; z < 20; z++){ |
Streaming just means a download that they don't want you to keep. But Chrome's developer tools make it easy to access what's really going on under the hood.
From the page where you want to download some things, go into your chrome menu to open the developer tools. You can either:
1. (On a mac): Command-option-J
2. (On a PC): Control-alt-J
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 appController = require('./appController'); | |
| //#!/usr/bin/env node |
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
| module.js:340 | |
| throw err; | |
| ^ | |
| Error: Cannot find module 'charm' | |
| at Function.Module._resolveFilename (module.js:338:15) | |
| at Function.Module._load (module.js:280:25) | |
| at Module.require (module.js:364:17) | |
| at require (module.js:380:17) | |
| at Object.<anonymous> (/usr/local/lib/node_modules/mrssysadmin/lib/terminal-menu/index.js:1:81) | |
| at Module._compile (module.js:456:26) |
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
| ; cli configs | |
| registry = "https://registry.npmjs.org/" | |
| ; userconfig /Users/danielfinlay/.npmrc | |
| cwd = "/usr/lib" | |
| ; node bin location = /usr/local/bin/node | |
| ; cwd = /Users/danielfinlay/Documents/Development/mrssysadmin | |
| ; HOME = /Users/danielfinlay | |
| ; 'npm config ls -l' to show all defaults. |