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 functional pattern, defined in Douglas Crockford's "Javascript: The Good Parts", allows for | |
| * JavaScript to achieve both inheritance and information hiding (private variables) with a compact syntax. | |
| * The specification that is passed in, as well as potentially more vars you may define in each pseudo-class, are not | |
| * accessible from the object that is returned, we consider these private variables. Public vars may | |
| * be added to the "that" return object as desired. | |
| */ | |
| /** | |
| * Person is our base pseudo-class |
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
| #!/bin/sh | |
| # | |
| # chkconfig: 35 99 99 | |
| # description: Node.js /home/nodejs/sample/app.js | |
| # | |
| . /etc/rc.d/init.d/functions | |
| USER="nodejs" |
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
| // Require.js allows us to configure shortcut alias | |
| require.config({ | |
| // The shim config allows us to configure dependencies for | |
| // scripts that do not call define() to register a module | |
| shim: { | |
| 'socketio': { | |
| exports: 'io' | |
| }, | |
| 'underscore': { | |
| exports: '_' |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
| <title>Stripe Sample Form</title> | |
| <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
| <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script> | |
| <script type="text/javascript" src="https://js.stripe.com/v1/"></script> | |
| <script type="text/javascript"> |
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 upload (req, res) { | |
| var Formidable = require('formidable'), | |
| form = new Formidable.IncomingForm(); | |
| form.encoding = 'utf-8'; | |
| form.onPart = function (part) { | |
| if (!part.filename) { | |
| form.handlePart(part); | |
| } else { | |
| (function () { |
NewerOlder