var fsP1 = fs.readFile('./file1');
var fsP2 = fs.readFile('./file2');
Promise.all([fsP1.ready(), fsP2.ready()]).then(function() {
/* Now have all data for both files */
}, function () {
/* something errored */
});
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
### Server 1 | |
```js | |
var level = require('level') | |
var replicate = require('level-replicator') | |
var db = replicate(level('/tmp/db')) | |
// put something into the database | |
db.put('some-key', 'some-value', function(err) { |
// // since a lambda with capture doesn't work as a function pointer, we should be able to // make a static cast to a function with the expected signature and return type, then // use that to emulate the expected c type callback function //
auto cb = [&](http_parser* parser, const char* at, size_t length) {
return 0;
};
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
=84543== Memcheck, a memory error detector | |
=84543== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. | |
=84543== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info | |
=84543== Command: ./webserver | |
=84543== | |
=84543== WARNING: Support on MacOS 10.8/10.9 is experimental and mostly broken. | |
=84543== WARNING: Expect incorrect results, assertions and crashes. | |
=84543== WARNING: In particular, Memcheck on 32-bit programs will fail to | |
=84543== WARNING: detect any errors associated with heap-allocated data. | |
=84543== |
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
Dear Paolo, | |
welcome back to iTunes Store Customer Support. My name is chotelal. | |
Paolo, I won't be able to assist you further because your account is not in compliance with the iTunes Store Terms and Conditions. I request you to read Apple's requirements for using the iTunes Store, see this page: | |
http://www.apple.com/legal/internet-services/itunes/ww | |
I hope the information provided is helpful. If you have any further query feel free to contact me I will be happy to assist you further. |
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
uv_fs_t stat_req; | |
uv_fs_t open_req; | |
uv_fs_t read_req; | |
uv_fs_t close_req; | |
int statR = uv_fs_stat(UV_LOOP, &stat_req, path, NULL); | |
const uv_stat_t* stat = static_cast<const uv_stat_t*>(stat_req.ptr); | |
int fd = uv_fs_open(UV_LOOP, &open_req, path, opts.flags, opts.mode, NULL); | |
int const size = (int) stat->st_size; |
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
//#include "../fs.h" | |
#include <assert.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <signal.h> | |
#include <stdlib.h> | |
#include <string> | |
#include <iostream> |
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
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
Version: GnuPG v1 | |
mQENBFThUsoBCACgIgoZnYZTaUSRvTcqDuHwyBfMgUWl+qavoVCM44KOIgWKzrLr | |
/6q9lH3DgkwKHJtg2QXw9NcM6DH8ZKlMJldSM8nf7U0d5EHsiB4WkiQG58olcooC | |
VxNAJIUmFirg7R0eLWBvpRMJwBIBeI8xQttrN7IOBvU4OF5Z9tqraYjVvj0sxLgH | |
Akxn8JVA0swO5oZ/k+EjCl2n2zpYjcKhE87mHUMafvvBv+ZlK17d25uVid1dgfRB | |
Imlp1I9OP2TYLkQuUxXh1vmlovniDOoGEC9Ttx1mD6JdhIcL/smeyhsXi9jMZver | |
VAZxdVp2yY9dq2rihpiBpKSrcjOZK79pNeg/ABEBAAG0NFBhb2xvIEZyYWdvbWVu | |
aSAoZ2l0aHViLmNvbS9oaWoxbngpIDxwYW9sb0Bhc3luYy5seT6JATgEEwECACIF |
I hereby claim:
- I am hij1nx on github.
- I am hij1nx (https://keybase.io/hij1nx) on keybase.
- I have a public key whose fingerprint is B6FE DF8F C71E D916 BE0A 7859 51C8 0B06 1A2A D4BE
To claim this, I am signing this object: