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
| Parallel: require('parallel').Parallel | |
| task: new Parallel { | |
| get_db_stuff: [db_method, arg1, arg2] | |
| build_templates: [haml.compile, 'my_template'] | |
| } | |
| task.run (name, arg1) -> | |
| if name is null | |
| puts 'done' |
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
| #include <v8.h> | |
| #include <node.h> | |
| using namespace v8; | |
| using namespace node; | |
| static Handle<Value> | |
| Test (const Arguments& args) { | |
| HandleScope scope; |
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
| <html> | |
| <head>...</head> | |
| <body> | |
| <?php | |
| define('MENU_DIR', 'menu'); | |
| $menuName = stripslashes($_GET['menu']); |
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
| if shouldBeDoingWork is true | |
| if facebookIsAvailable | |
| screwed() | |
| else if tvIsAvailable | |
| semiScrewed() | |
| else | |
| stareOutOfWindow() |
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
| tim@Tims-MacbookPro:~/Projects/node$ ./configure | |
| Checking for program g++ or c++ : /usr/bin/g++ | |
| Checking for program cpp : /usr/bin/cpp | |
| Checking for program ar : /usr/bin/ar | |
| Checking for program ranlib : /usr/bin/ranlib | |
| Checking for g++ : ok | |
| Checking for program gcc or cc : /usr/bin/gcc | |
| Checking for gcc : ok | |
| Checking for library dl : yes | |
| Checking for library execinfo : not found |
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
| tim@Tims-MacbookPro:~/Projects/node$ make test | |
| Waf: Entering directory `/home/tim/Projects/node/build' | |
| DEST_OS: linux | |
| DEST_CPU: x86 | |
| Parallel Jobs: 1 | |
| Waf: Leaving directory `/home/tim/Projects/node/build' | |
| 'build' finished successfully (1.170s) | |
| python tools/test.py --mode=release simple | |
| === release test-http-exceptions === | |
| Path: simple/test-http-exceptions |
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
| tim@Tims-MacbookPro:~/Projects/node-router$ ab -n 800 -c 100 http://localhost:8000/assets/me.jpg | |
| This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
| Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
| Licensed to The Apache Software Foundation, http://www.apache.org/ | |
| Benchmarking localhost (be patient) | |
| Completed 100 requests | |
| Completed 200 requests | |
| Completed 300 requests | |
| Completed 400 requests |
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
| http.createServer(function(request, response) { | |
| fs.readFile('some_file.html', function(err, buffer) { | |
| if (err) throw err; | |
| response.writeHead(200, { | |
| 'Content-Type': 'text/html', | |
| 'Content-Length': buffer.length | |
| }); | |
| response.end(buffer); |
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
| spawn: require('child_process').spawn | |
| JAVA_PATH: exports.JAVA_PATH: 'java' | |
| JAR_PATH: exports.JAR_PATH: 'vendor/compiler.jar' | |
| OPTIONS: exports.OPTIONS: {} | |
| exports.compile: (input, options, callback) -> | |
| if callback | |
| result: Object.create OPTIONS | |
| for name, option in options |
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 router | |
| router: require 'node-router' | |
| server: router.getServer() | |
| asset: require 'node-asset' | |
| # Javascript package | |
| scripts: new asset.Package 'assets/js/all.js', [ | |
| 'assets/coffee' | |
| ], { | |
| watch: true |