Skip to content

Instantly share code, notes, and snippets.

View heapwolf's full-sized avatar
🕷️
Vault of the Black Spiders

heapwolf heapwolf

🕷️
Vault of the Black Spiders
View GitHub Profile
### 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) {
@heapwolf
heapwolf / js.md
Last active August 29, 2015 14:04
promises are fucking ugly.

UGLY

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 */
});

// // 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;
};
=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==

SYNOPSIS

bale is a preprocessor for c++ that provides a working module system.

EXAMPLE

#require "./foo.cc" foo

int main() {
  foo.x("ok");
}
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.
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;
//#include "../fs.h"
#include <assert.h>
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <string>
#include <iostream>
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQENBFThUsoBCACgIgoZnYZTaUSRvTcqDuHwyBfMgUWl+qavoVCM44KOIgWKzrLr
/6q9lH3DgkwKHJtg2QXw9NcM6DH8ZKlMJldSM8nf7U0d5EHsiB4WkiQG58olcooC
VxNAJIUmFirg7R0eLWBvpRMJwBIBeI8xQttrN7IOBvU4OF5Z9tqraYjVvj0sxLgH
Akxn8JVA0swO5oZ/k+EjCl2n2zpYjcKhE87mHUMafvvBv+ZlK17d25uVid1dgfRB
Imlp1I9OP2TYLkQuUxXh1vmlovniDOoGEC9Ttx1mD6JdhIcL/smeyhsXi9jMZver
VAZxdVp2yY9dq2rihpiBpKSrcjOZK79pNeg/ABEBAAG0NFBhb2xvIEZyYWdvbWVu
aSAoZ2l0aHViLmNvbS9oaWoxbngpIDxwYW9sb0Bhc3luYy5seT6JATgEEwECACIF

Keybase proof

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: