Skip to content

Instantly share code, notes, and snippets.

View tim-smart's full-sized avatar

Tim tim-smart

View GitHub Profile
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'
#include <v8.h>
#include <node.h>
using namespace v8;
using namespace node;
static Handle<Value>
Test (const Arguments& args) {
HandleScope scope;
<html>
<head>...</head>
<body>
<?php
define('MENU_DIR', 'menu');
$menuName = stripslashes($_GET['menu']);
if shouldBeDoingWork is true
if facebookIsAvailable
screwed()
else if tvIsAvailable
semiScrewed()
else
stareOutOfWindow()
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
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
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
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);
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
# 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