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
<? | |
// These are so benificial, they default to true. | |
if (!isset($use_page_cache)) | |
$use_page_cache = 1; | |
if (!isset($use_compression)) | |
$use_compression = 1; | |
// Add browsers here as we must detect them. Opera is an oddball, if we don't detect | |
// it specifically, it will turn up as MSIE |
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
// var sys = require('sys'); // enable for debugging this module | |
function replace(a, b) | |
{ | |
if (!b) return a; | |
var key; | |
for (key in b) a[key] = b[key]; | |
return a; | |
} this.replace=replace; | |
function add(a, b) |
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
var _ = require('merger'); // lets do: _.extend(same,otherobjexts), _.clone(obj) - creates new reference, see source to understand // | |
var sys = require('sys'); | |
var doubletemplate = require('deps/nodejs-meta-templates/doubletemplate'); //load double teplate module | |
var httputils = require('httputils'); | |
var ObjectID= require('deps/node-mongodb-native/lib/mongodb/bson/bson').ObjectID; | |
var step=require('deps/step/lib/step'); | |
/* | |
+tables - collections | |
\/ |
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
/var/www/nodejs-mongodb-app/cachedfiles_page.js:282 | |
var buf=new Buffer(data,'utf8'); | |
^ | |
TypeError: Bad argument | |
at /var/www/nodejs-mongodb-app/cachedfiles_page.js:282:18 | |
at fs:83:13 | |
at node.js:255:9 | |
var fs = require('fs'); // allaws to open files |
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
var fs = require('fs'); | |
var http = require('http'); | |
var Buffer = require('buffer').Buffer; | |
var gif; | |
fs.readFile(__filename, function (err, data) | |
{ | |
if (err) throw err; | |
gif = new Buffer(data, 'utf8'); | |
}); |
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
the blog is in comments below |
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
var sys = require("sys"), | |
fs = require('fs'), | |
url = require('url'), | |
http = require("http"), | |
multipart = require("./lib/multipart"); | |
var name, filename, file,file2; | |
http.createServer(function (request, response) { | |
switch (url.parse(request.url).pathname) { |
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
var sys = require("sys"), | |
fs = require('fs'), | |
url = require('url'), | |
http = require("http"), | |
multipart = require("./lib/multipart"); | |
http.createServer(function (request, response) { | |
switch (url.parse(request.url).pathname) { |
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
//thanks to creationix - large protion of the code here is learned from his connect library. | |
var querystring = require('querystring'); | |
var sys = require('sys'); | |
var multipart = require("deps/multipart-js/lib/multipart"); | |
var fs = require('fs'); | |
this.postdecoders = | |
{ | |
'application/x-www-form-urlencoded': querystring.parse, |
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
var http = require('http'); | |
var url = require('url'); | |
//var sys = require('sys'); | |
var mylog="log:\r\n"; | |
/* | |
<shimondoodkin> i have a problem with http if i define the on end and on data callbacks after like 120 ms it does not call callbacks or maybe if it is clouse inside a clousre, the object looks ok but it does not fire the events | |
[01:52] <bradleymeck> is the request done by 120ms? | |
[01:52] <shimondoodkin> it hangs | |
[01:52] <shimondoodkin> after a minute it fails | |
*/ |