Skip to content

Instantly share code, notes, and snippets.

View sidorares's full-sized avatar

Andrey Sidorov sidorares

View GitHub Profile

Code of Conduct

All attendees, speakers, sponsors and volunteers at our event are required to agree with the following code of conduct. Organisers will enforce this code throughout the event. We are expecting cooperation from all participants to help ensuring a safe environment for everybody.

Need Help?

Contact one of the event organisers. The list of organisers for each event can be seen on event page.

The Quick Version

Our event is dedicated to providing a harassment-free event experience for everyone, regardless of gender, age, sexual orientation, disability, physical appearance, body size, race, or religion (or lack thereof). We do not tolerate harassment of event participants in any form. Sexual language and imagery is not appropriate for any event venue, including talks, workshops, parties, Twitter and other online media. Event participants violating these rules may be sanctioned or expelled from the event at the discretion of the organisers.

/*
HelloX.C
========
(c) Copyright Paul Griffiths 1999
Email: mail@paulgriffiths.net
"Hello, World!", X Window System style.
*/
var Chrome = require('chrome-remote-interface');
var chooseTab = function(tabs) {
return 0;
};
Chrome({ chooseTab: chooseTab }, function(chrome) {
var CSS = chrome.CSS;
CSS.styleSheetAdded(function() {
console.log('added');
var cluster = require('cluster');
var http = require('http');
var numCPUs = require('os').cpus().length;
if (cluster.isMaster) {
// Fork workers.
for (var i = 0; i < numCPUs; i++) {
cluster.fork();
}
module.exports['ch.epfl.mobots.AsebaNetwork'] = function(bus) {
this.addListener = this.on = function(signame, callback) {
bus.addMatch('type=\'signal\',member=\'' + signame + '\'', function(err, result) {
if (err) throw new Error(err);
});
var signalFullName = bus.mangle('/', 'ch.epfl.mobots.AsebaNetwork', signame);
bus.signals.on(signalFullName, function(messageBody) {
callback.apply(null, messageBody);
});
};
@sidorares
sidorares / benchmark.md
Last active March 29, 2022 12:30
node-mysql2 benchmarks

Benchmarks of node-mysql vs node-mysql2 drivers

Test1:

for each http request, query first 3 rows of mysql.user table and render results using jade template.

Notes: This tests column definition parser (user table has 43 columns), row parser (3x43 values) and access time to result. Also this is test of how well event loop, GC, http parser and mysql driver work together. To compare mysql overhead with http + jade rendering + data transfer, there is another endpoint that renders exactly the same rows of data from memory without fetching them from mysql server.

// scraped from https://mariadb.com/kb/en/mariadb/documentation/sql-language-structure/mariadb-error-codes/
//
module.exports = [
[
"1000",
"HY000",
"ER_HASHCHK",
"hashchk"
],
[
var x11 = require('x11');
var PNG = require('png-js');
var bl = require('bl');
require('child_process').exec('locate png | grep 48').stdout.pipe(bl(function(err, files) {
var pngNames = files.toString().split('\n');
var pngIndex = 0;
x11.createClient(function(err, display) {
@sidorares
sidorares / launcher-test.desktop
Created September 30, 2014 03:29
Unity integration for node-x11
[Desktop Entry]
Name=Unity Launcher test
GenericName=Oooooooooooooooooooooooooooo
Comment=Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Exec=/home/laplace/ltest/test.js
Icon=system-software-update
Terminal=false
Type=Application
Categories=System;Settings;
> x11@0.10.0 test /tmp/node-x11
> node test-runner.js
Atoms and atom names cache
✓ should be used directly when requesting std atoms with InternAtom
✓ should be used directly when requesting atom names with GetAtomName
✓ should be used after the first request for non-std atoms
✓ should be used after the first request for non-std atom_names