Re: [nodejs] Would love feedback - TLC templating language for Isomorphic web development

2015-07-22 Thread Gustavo Machado
Hi Brian, Looks good, I would try to make the readme a little bit more clear/concise, and as for the library, why do you need a class at all? var tlc = new TLC(); As far as I could tell by the examples, "tlc" doesn't hold too much state and if it did it could probably be global in most cases.

Re: [nodejs] Why doesn't errors to the stdout on linux have line numbers or stack traces?

2015-07-22 Thread Gustavo Machado
Hopefully this will clarify: > var er = new Error('foo'); undefined > er.toString() 'Error: foo' > er.message 'foo' > er.stack 'Error: foo\nat repl:1:10\nat REPLServer.self.eval (repl.js:110:21)\nat repl.js:249:20\nat REPLServer.self.eval (repl.js:122:7)\nat Interface. (repl.js

Re: [nodejs] How to overload the URL fetch in npm?

2015-07-01 Thread Gustavo Machado
You might be able to use something like this: https://github.com/mixu/npm_lazy Thanks, Gus On Sun, Jun 28, 2015 at 8:20 PM, Yuri Vic wrote: > I want to create the package for one nodejs-based project. All files that > are required to be downloaded should be downloaded and fingerprinted before >

Re: [nodejs] beginner question on return syntax and use

2015-06-25 Thread Gustavo Machado
Guy, The function is returning an object, pretty much like { "foo": "bar" }, but it happens to contain the functions the it wants to expose to the caller. Gus On Thu, Jun 25, 2015 at 2:44 PM, Guy Duff wrote: > Hi, and thanks for having this forum. I am reading the book entitled > beginning nod

Re: [nodejs] timed promises

2015-06-25 Thread Gustavo Machado
Hi Alen, Check out the "race" method of promises, might help simplify this a lot. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race Cheers, Gus On Thu, Jun 25, 2015 at 3:06 PM, wrote: > Hello, > > Being relatively new to promises, a few months into

Re: [nodejs] Re: Newbie Question

2015-06-22 Thread Gustavo Machado
Ray, a few clarifications on Grant's email. By setting things up with NGINX, it now becomes your point of entry for your user's traffic (hence the name "reverse-proxy"). Cheers! Gus On Sun, Jun 21, 2015 at 7:56 AM, Grant MacDonald wrote: > Hi Ray. If the node.js was running on realserver.com:5

Re: [nodejs] Multi-tenant with multiple databases?

2015-06-22 Thread Gustavo Machado
Not sure how many tenants you plan to have in memory, but you should probably check out some (memory) caching libraries. Cheers, Gus On Tue, Jun 9, 2015 at 1:39 AM, Aria Stewart wrote: > > > On 8 Jun 2015, at 23:38, Steve P wrote: > > > > I'm working on a multi-tenant app in which each client

Re: [nodejs] Installing NodeJs on Build Server (for Local System)

2013-03-05 Thread Gustavo Machado
Do you have an error or log? Have you tried installing the 32bit version? Gustavo Machado machad...@gmail.com On Mar 5, 2013, at 5:39 PM, Tom Cabanski wrote: > Installed via the installer for 0.8.21 (64bit) downloaded this morning. > Installed as a domain user that happens to als

Re: [nodejs] Installing NodeJs on Build Server (for Local System)

2013-03-05 Thread Gustavo Machado
Hello Tom, Yes it is possible. Use the installer download, and it will be accessible to every user: http://nodejs.org/download/ Gustavo Machado machad...@gmail.com On Mar 5, 2013, at 9:30 AM, Tom Cabanski wrote: > We use NodeJs as part of our build process. Would like to install NodeJs

Re: [nodejs] code execution should wait for a function to be returned

2013-03-05 Thread Gustavo Machado
/this will execute after log finished. Cheers, Gustavo Machado machad...@gmail.com On Mar 5, 2013, at 8:14 AM, Siva Pratap Palakurthi wrote: > Hi all, > I wanted to write a logging utility in node.js app. So i will call a function > multiple times in code, and the code after the call sh

[nodejs] http.Server - ending an upgrade request

2013-03-05 Thread Gustavo Machado
Hello, Which is the recommended way to send a 404 in an upgrade request (ws://...) in: http://nodejs.org/api/http.html#http_event_upgrade I am trying this: socket.end('HTTP/1.1 404 Not found', 'utf8'); Looks like web sockets clients are not liking it. Thanks, Gu

Re: [nodejs] Error: write EPIPE

2013-02-22 Thread Gustavo Machado
mmand, { cwd: path.join(__dirname, folder) }, callback || function(){}); childProc.stdout.pipe(process.stdout); childProc.stderr.pipe(process.stderr); } Thanks, Gustavo On Thu, Feb 21, 2013 at 7:05 PM, Ben Noordhuis wrote: > On Thu, Feb 21, 2013 at 6:17 PM, Gustavo Machado >

Re: [nodejs] Re: Does NodeJs support https?

2013-02-21 Thread Gustavo Machado
Make sure you use the "secure" option on the client side: ar socket = io.connect('https://localhost', {secure: true}); Gustavo Machado machad...@gmail.com On Feb 21, 2013, at 3:47 PM, Harald Hanche-Olsen wrote: > [Burak Gürbüz (2013-02-21 17:09:28 UTC)] > >&

Re: [nodejs] Error: write EPIPE

2013-02-21 Thread Gustavo Machado
Hi, In turned out to be the process.stdout. Apart from reducing the console.logs to a minimum, we are planning to use epipebomb to avoid the process to crash under heavy load. Is there any way to re-open the connection to the console.log after it's been EPIPE'd ? Thanks, Gusta

Re: [nodejs] Error: write EPIPE

2013-02-20 Thread Gustavo Machado
to be able to close my end (am I right?). Judging by the stack trace, I won't be able to do so. Can you point me to some more information on how to handle this exception? Thanks, Gustavo Machado -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/w

[nodejs] Error: write EPIPE

2013-02-19 Thread Gustavo Machado
uot;at errnoException (net.js:770:11)", "at Object.afterWrite (net.js:594:19)" ], Node version: 0.8.16 What is the right way to handle/avoid this potential error? Any documentation I could look into? On a somewhat related note, what's the status

[nodejs] Node.js webserver hangs

2013-02-05 Thread Gustavo Machado
Hello, a rather theoretical question. What are the possible causes for a server to stop responding to the most simple requests? How can one troubleshoot this kind of problem if it's not trivial to reproduce? Thanks, Gustavo Machado -- -- Job Board: http://jobs.nodejs.org/ Posting guide

Re: [nodejs] Running javascript code "safely"

2013-01-22 Thread Gustavo Machado
Jorge, That's an interesting approach, however it does not support windows, am I correct? How about it's stability, I can see that it's in 0.1.4, are you confident running it in production? Thanks, Gustavo Machado machad...@gmail.com On Jan 20, 2013, at 8:32 AM, Jorge

Re: [nodejs] Running javascript code "safely"

2013-01-18 Thread Gustavo Machado
radley, I almost gave up when I decided to give sandbox a try. I installed the "npm" version, and based on the examples[1] seems like caller and type coercion attacks are being properly handled. Was there another scenario that was broken due to the newer version of v8? Thanks for your

Re: [nodejs] Running javascript code "safely"

2013-01-18 Thread Gustavo Machado
e > code execution. I know ways that horrify people using just type coercion. But > lets get down to the truth of security: Are those fixes you wrote, on the node-sandbox module? Can you please refer me to the changes you had to do? We'll spend some time trying to figure it out. Tha

Re: [nodejs] Running javascript code "safely"

2013-01-17 Thread Gustavo Machado
On Jan 16, 2013, at 7:18 PM, Diogo Resende wrote: > I would try a parser like uglify to detect if require() is called in the > code. If not I would accept the "script". You could check more things but > that is the most important. > I believe that stuff like this: http://news.ycombinator.com

Re: [nodejs] Running javascript code "safely"

2013-01-17 Thread Gustavo Machado
he call to run in some other function like setTimeout, process.nextTick, however I can still gain access to these which are still dangerous. Thoughts? Suggestions? Thanks, Gustavo Machado On Thu, Jan 17, 2013 at 11:30 AM, Gustavo Machado wrote: > Looks like "contextify" is what we

Re: [nodejs] Running javascript code "safely"

2013-01-17 Thread Gustavo Machado
Looks like "contextify" is what we need. I'll have to test for caller attacks, but it looks like it will work. Thanks, Gustavo Machado On Jan 16, 2013, at 9:08 PM, Berger Kennedy FOTSO wrote: > https://npmjs.org/package/contextify > > or maybe > https://npm

[nodejs] Running javascript code "safely"

2013-01-16 Thread Gustavo Machado
/blob/master/example/example.js but are looking for some other choices. Thanks, Gustavo Machado -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Group

[nodejs] Benchmarking Express.js App

2012-11-02 Thread Gustavo Machado
Hi, I would like to start a series of benchmarks of a few apps we have running with node.js so I decided to run a baseline benchmark on a vanilla express.js application with the following route: app.get('/', function ( req, res ) { res.end("hello world"); }); I ran ApacheBench like this: .\ab.

Re: [nodejs] Best practices for sharing code and data between the server and client

2012-10-03 Thread Gustavo Machado
Here's a pretty good article about doing it with AMD: http://joseoncode.com/2012/08/30/share-your-server-side-templates-to-the-browser/ Gus On Mon, Oct 1, 2012 at 11:55 PM, Ted Young wrote: > > > > One problem - was no easy way (or I didn't found it) to browserify also > templates for my backbo

Re: [nodejs] express and formidable and restful server and sending a file from a REST client

2012-10-03 Thread Gustavo Machado
Maybe this can help. When trying to use ajax uploader and also plain forms, I found that I had to do something like this it's coffeescript): if req.xhr req.tempFile = path.join(tmp.tmpdir, req.header("x-file-name")) writer = fs.createWriteStream(req.tempFile)

Re: [nodejs] TypeScript and node.js

2012-10-01 Thread Gustavo Machado
reeter.prototype.greet = function(a: string) { return "Hello, " + a; } Translates to this: Greeter.prototype.greet = function (a) { return "Hello, " + a; }; So no +1 for TypeScript in this case :) Gus On Mon, Oct 1, 2012 at 6:36 PM, Rick Waldron wrote: > > > On

Re: [nodejs] TypeScript and node.js

2012-10-01 Thread Gustavo Machado
> For less sophisticated developers (most people, and most of the VS > market), the compiler errors will remove much debugging frustration and > allow them to focus on creating rather than debugging. > > It also allows them to focus on "creating" instead of understanding what they are doing. Take t

Re: [nodejs] Re: SNI with Internet Explorer 9

2012-09-27 Thread Gustavo Machado
res.writeHead(200); res.end("hello world\n"); }).listen(8001); Thanks, Gustavo On Thu, Sep 27, 2012 at 6:17 AM, Fedor Indutny wrote: > This is not related to SNI at all. (I'm working at Nodejitsu). > > > > > On Wed, Sep 26, 2012 at 10:41 PM, Gustavo Machado w

Re: [nodejs] Re: Windows - USB Install - Modules

2012-09-26 Thread Gustavo Machado
Hi Glenn, neither of those two links seem to be working for me. gus On Wed, Sep 26, 2012 at 5:43 AM, Glenn Block wrote: > All you should need to do is run npm ahead of time and then copy the app > including the node_modules folder. > > Crate (https://gitcafe.com/hujs/) is a new project that we

Re: [nodejs] Re: SNI with Internet Explorer 9

2012-09-26 Thread Gustavo Machado
think IE is the only one browser that doesn't support SNI at all. > > > > On Wed, Sep 26, 2012 at 9:36 PM, Gustavo Machado wrote: > >> Sorry, here's the code to reproduce the problem: >> >> https://gist.github.com/3789357 >> >> Gus >> &

[nodejs] Re: SNI with Internet Explorer 9

2012-09-26 Thread Gustavo Machado
Sorry, here's the code to reproduce the problem: https://gist.github.com/3789357 Gus On Wed, Sep 26, 2012 at 2:30 PM, Gustavo Machado wrote: > Hi guys, > > I have a rather strange problem when trying to use node.js with HTTPS and > SNI. In order to reproduce the error, you w

[nodejs] SNI with Internet Explorer 9

2012-09-26 Thread Gustavo Machado
Hi guys, I have a rather strange problem when trying to use node.js with HTTPS and SNI. In order to reproduce the error, you would have to open internet options in IE 9, and check: SSL v2 SSL v3 TLS 1.0 TLS 1.1 (do not check TLS 1.2) And verify that the SNICallback is not being called: SNICallb

Re: [nodejs] Re: Raft - PaaS - Advice from nodester / nodejitsu / haibu

2012-08-15 Thread Gustavo Machado
Nodejitsu/Haibu guys, Do you have more than one Haibu server running? And if so, how would you go about doing ReverseProxy/LoadBalancing? Thanks, Gustavo Machado On Mon, Aug 13, 2012 at 2:03 PM, chrismatthieu wrote: > Hi Tim, > > I'm the founder of Nodester, the open source Node.

Re: [nodejs] Re: JavaScript "editor" that might be great for node development

2012-08-14 Thread Gustavo Machado
At first I thought you guys were being a little harsh but now I see you were being very polite! :) Gus On Tue, Aug 14, 2012 at 4:53 PM, Bruno Jouhier wrote: > OMG! The return of SQL Windows / Gupta / Centura! > > > On Tuesday, August 14, 2012 6:44:52 AM UTC+2, Michael Sydney Balloni wrote: >> >>

Re: [nodejs] Re: Connect/Express Static with a prefix url

2012-08-07 Thread Gustavo Machado
ath.resolve(root, 'app.uploads'))) > .use(express.static(path.resolve(root, 'app.www'))); > > > Best regards, > Andreas Lind Petersen (papandreou) > > On Tuesday, August 7, 2012 5:18:37 PM UTC+2, Gustavo Machado wrote: >> >> Hi, >>

Re: [nodejs] How do you handle if/else with async inside

2012-08-07 Thread Gustavo Machado
Here is one approach which is pretty interesting: http://joseoncode.com/2012/06/24/messing-with-cps-in-js/ We are currently using iced-coffee-script in a project and I couldn't be any happier, what you wrote would translate to: if cod await trueFn defer(err, result) else await falseFn defer(e

Re: [nodejs] CraftyJS, Node.js, SocketIO, V8 woes.

2012-08-07 Thread Gustavo Machado
Adam, which other ones do you recommend? Gus On Sun, Aug 5, 2012 at 7:41 PM, Adam Reynolds wrote: > I know this is slightly off-topic but why did you choose crafty over the > other game engine that are out there? > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.

[nodejs] Connect/Express Static with a prefix url

2012-08-07 Thread Gustavo Machado
Hi, I am using the following folder structure for an expressjs website: /app.www /app.uploads I would like to use the static middleware to server the files in the app.uploads folder, but with the following prefix: "/uploads": http://localhost:3000/b.jpg <-- /app.www/b.jpg http://localhost:3000/

Re: [nodejs] node-jwt-simple

2012-07-20 Thread Gustavo Machado
, Jul 17, 2012 at 6:44 PM, Gustavo Machado wrote: > I finally figured it out, I was missing the -nodes parameter in the > openssl command, so the private key was not being exported. Tried it > and it's working now. > > Thanks for the help! > Gustavo > > On Tue, Jul 17, 201

Re: [nodejs] node-jwt-simple

2012-07-17 Thread Gustavo Machado
I finally figured it out, I was missing the -nodes parameter in the openssl command, so the private key was not being exported. Tried it and it's working now. Thanks for the help! Gustavo On Tue, Jul 17, 2012 at 6:35 PM, Gustavo Machado wrote: > Hi Dick, > > Thanks for pointing th

Re: [nodejs] node-jwt-simple

2012-07-17 Thread Gustavo Machado
ccess tab and you can generate and get your keys there > > -- Dick > > On Jul 17, 2012, at 2:14 PM, Gustavo Machado wrote: > >> When using Google APIs from a service (without requiring your users to >> log into google) I think you need to use this auth method: >> &g

Re: [nodejs] node-jwt-simple

2012-07-17 Thread Gustavo Machado
jwt? > > On Jul 17, 2012, at 1:50 PM, Gustavo Machado wrote: > >> Hi, >> >> Has anybody used the node-jwt-simple module to log into Google APIs? >> In particular, I need to know where to pull the 'secret' parameter >> from my Google APIs account.

[nodejs] node-jwt-simple

2012-07-17 Thread Gustavo Machado
Hi, Has anybody used the node-jwt-simple module to log into Google APIs? In particular, I need to know where to pull the 'secret' parameter from my Google APIs account. Thanks, Gustavo -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Po

Re: [nodejs] Re: Analytics for node.js

2012-07-12 Thread Gustavo Machado
> > http://nodetime.com/ > > Den onsdagen den 11:e juli 2012 kl. 22:41:19 UTC+2 skrev Gustavo Machado: > >> Hi, >> >> Does anyone know of any analytics modules for node.js web servers? More >> specifically to analyze the traffic on an expressjs application.

[nodejs] Analytics for node.js

2012-07-11 Thread Gustavo Machado
Hi, Does anyone know of any analytics modules for node.js web servers? More specifically to analyze the traffic on an expressjs application. Thanks, Gus -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received th

Re: [nodejs] What is the best convention for loading routes

2012-06-18 Thread Gustavo Machado
Check out this project for resource-oriented routing: https://github.com/visionmedia/express-resource . Looks pretty good too. Gus On Mon, Jun 18, 2012 at 1:37 PM, cort fritz wrote: > Thank you! > > In my ignorance I am undeterred from wanting to automatically load all > files. > > My top two

Re: [nodejs] - Github Followers Thread

2012-06-02 Thread Gustavo Machado
https://github.com/machadogj Cheers! Gus On Sat, Jun 2, 2012 at 8:57 PM, Jake Verbaten wrote: > And around we go! > > https://github.com/Raynos > > > On Sun, Jun 3, 2012 at 12:55 AM, Marak Squires wrote: > >> Let's get this bump fest going. >> >> https://github.com/marak >> https://github.com/

Re: [nodejs] Re: Laying out an API project using restify

2012-06-02 Thread Gustavo Machado
; > On Sat, Jun 2, 2012 at 8:13 AM, Gustavo Machado wrote: > >> In our team, we use the pattern Glenn Block described, and it's a very >> cool way of organizing your routes. What we do, is add a "hook" method in >> each resource, and we pass the "app&qu

Re: [nodejs] Re: Laying out an API project using restify

2012-06-02 Thread Gustavo Machado
In our team, we use the pattern Glenn Block described, and it's a very cool way of organizing your routes. What we do, is add a "hook" method in each resource, and we pass the "app" object so that every resource gets to define it's own endpoints. The only problem I've seen so far, is that you don't

Re: [nodejs] Re: OAuth2 Server

2012-05-29 Thread Gustavo Machado
gt; > https://github.com/ammmir/node-oauth2-provider > > > On Monday, May 28, 2012 3:18:09 PM UTC-7, Gustavo Machado wrote: >> >> Hi List! >> >> Does anybody recommend any production-ready packages to implement OAuth2 >> Server for my application? This

[nodejs] OAuth2 Server

2012-05-28 Thread Gustavo Machado
Hi List! Does anybody recommend any production-ready packages to implement OAuth2 Server for my application? This one looks good but doesn't seem to be very active: https://github.com/AF83/oauth2_server_node Thanks in advance! Gustavo -- Job Board: http://jobs.nodejs.org/ Posting guidelines: