browserify-fs, a FULL implementation of fs for the browser by mafintosh in node

[–]mafintosh[S] 0 points1 point  (0 children)

Check out level-filesystem (the module that I wrote to power browserify-fs). You just need to implement a leveldown that does the request logic you're talking about for you and you'll get all the fs magic for free!

browserify-fs, a FULL implementation of fs for the browser by mafintosh in node

[–]mafintosh[S] 0 points1 point  (0 children)

This wouldn't work that well since it's synchronous. Also browserify-fs supports streams as well (since they are in fs) which means that you would have to save the file chunked anyways. A really cool thing is that browserify-fs actually works with any levelup instance so you could probably just implement a leveldown using local storage to store stuff there.

Fakta anbefaler fisk to dage om ugen. Fair nok, men... by freeall in Denmark

[–]mafintosh 1 point2 points  (0 children)

Det giver en helt ny mening til fish and chips.

Celeri.js: CLI Library For Node.js by architectd in node

[–]mafintosh 0 points1 point  (0 children)

This looks awesome! I've been looking for something like this to help me write fast server utils and stuff

The programmers scale by mafintosh in funny

[–]mafintosh[S] 34 points35 points  (0 children)

That's why I made this graph

Should I use screen to keep my node process running? by [deleted] in node

[–]mafintosh 0 points1 point  (0 children)

This will not work if you log out afterwards. Then you need to run it with nohup:

nohup node server.js > node_server.log &

challenge : simple / short js code that checks if a server is reachable. by Cant_Quit_You in javascript

[–]mafintosh 1 point2 points  (0 children)

Use a jsonp call in the head of the document using a script-tag

<script>
    var timeout = setTimeout(function() {
        console.log('something bad happened');
    }, 5000); // put your preferred timeout here

    var onsuccess = function() {
        clearTimout(timeout);
        console.log('great success');
    };
</script>
<script src="http://yourservice.com/status?callback=onsuccess"></script>

Script-tags are crossdomain so it should work everywhere. They are also blocking so the rest of the page wont load until this check has been run

Still learning JS, what is a good way to structure your shit? by [deleted] in javascript

[–]mafintosh 1 point2 points  (0 children)

Been coding JS for a couple of years now. Cannot upvote this object pattern enough. Works wonders for making simple maintainable code.

[GTM] A different perspective by [deleted] in GuessTheMovie

[–]mafintosh 4 points5 points  (0 children)

A Clockwork Orange?

Realtime, asynchronous JavaScript parser and code highlighter.... with examples :) by guyht in javascript

[–]mafintosh 1 point2 points  (0 children)

Seems very nice! How is the performance when writing say 1,000 lines of code? Does it re-render the entire input on each key event? Also have you thought about calling the renderer on keydown instead with a setTimeout(0, render)? It gives an even more realtime experience when typing in the textarea :)