Skip to content

Instantly share code, notes, and snippets.

View pcan's full-sized avatar

Pierantonio Cangianiello pcan

View GitHub Profile
@pcan
pcan / nodejs-create-environment-method.cc
Created August 24, 2017 14:05 — forked from ghaiklor/nodejs-create-environment-method.cc
NodeJS Create Environment method
Environment* CreateEnvironment(Isolate* isolate, uv_loop_t* loop, Handle<Context> context, int argc, const char* const* argv, int exec_argc, const char* const* exec_argv) {
HandleScope handle_scope(isolate);
Context::Scope context_scope(context);
Environment* env = Environment::New(context, loop);
isolate->SetAutorunMicrotasks(false);
uv_check_init(env->event_loop(), env->immediate_check_handle());
uv_unref(reinterpret_cast<uv_handle_t*>(env->immediate_check_handle()));
@pcan
pcan / XRDP.md
Last active May 3, 2019 10:42
XRDP Configuration for Xubuntu 16.04

XRDP Configuration for Xubuntu 16.04

This guide includes some content from the official guide "Building on Debian 8", plus some updates.

Prerequisites

Tested on Xubuntu 16.04, fresh install. I'm using xrdp v.0.9.6 in this guide: some adaptations may be necessary for other releases. Since the official guide uses an environment variable during the build, the whole setup should be performed within a single shell console.

Dependencies

@pcan
pcan / worker.ts
Last active March 17, 2025 13:18
Run Worker threads using `tsx`
import { parentPort } from "worker_threads";
parentPort?.on("message", (message) => {
console.log("Received message from main thread:", message);
});