Skip to content

Instantly share code, notes, and snippets.

View sidorares's full-sized avatar

Andrey Sidorov sidorares

View GitHub Profile
@sidorares
sidorares / gist:9181766
Created February 24, 2014 04:03
examle: capture all scopes on exception
function bbb(x) {
var cc = x + 1;
var dd = cc + 2;
debugger;
return dd;
}
setInterval(function() {
var aa = 123;
//debugger;
function encode(data) {
var chunk = data.toString();
return chunk.length.toString(16) + "\r\n" + chunk + "\r\n";
}
var server = new HTTP.Server("localhost", 8000);
server.onRequest = function (request) {
log( "path: " + request.path );
log( "query string: " + request.query_string );
function encode(data) {
var chunk = data.toString();
return chunk.length.toString(16) + "\r\n" + chunk + "\r\n";
}
var server = new HTTP.Server("localhost", 8000);
server.onRequest = function (request) {
log( "path: " + request.path );
log( "query string: " + request.query_string );
TCP.connect ({
host: "google.com",
port: 80,
connected: function () {
log("connected to google.com");
}
});
### Keybase proof
I hereby claim:
* I am sidorares on github.
* I am sidorares (https://keybase.io/sidorares) on keybase.
* I have a public key whose fingerprint is 4899 77FC 876C 35BE 2738 875A 93C1 A8CE 1680 0045
To claim this, I am signing this object:
Statistical profiling result from v8-3.22.24.19.log, (91 ticks, 0 unaccounted, 0 excluded).
[Shared libraries]:
ticks total nonlib name
45 49.5% 0.0% /usr/local/bin/node
10 11.0% 0.0% [vdso]
2 2.2% 0.0% /lib/i386-linux-gnu/libc-2.15.so
[JavaScript]:
ticks total nonlib name
> 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
@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;
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) {
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);
});
};