Skip to content

Instantly share code, notes, and snippets.

View gmiroshnykov's full-sized avatar

George Miroshnykov gmiroshnykov

  • Dojo
View GitHub Profile
laggyluke@ubuntu:~$ ab -n 1000 -c 100 http://127.0.0.1:8124/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
@gmiroshnykov
gmiroshnykov / gist:837711
Created February 21, 2011 21:17
sudo npm link --loglevel verbose
vagrant@vagrantup:/opt/euro-web$ sudo npm link --loglevel verbose
npm info it worked if it ends with ok
npm verb cli [ 'link',
npm verb cli '--loglevel',
npm verb cli 'verbose' ]
npm info using npm@0.3.3
npm info using node@v0.4.1
npm verb config file /home/vagrant/.npmrc
npm verb config file /usr/local/etc/npmrc
npm info link /opt/euro-web
var vows = require('vows'),
assert = require('assert');
vows.describe('Buggy Test').addBatch({
'when async test returns error': {
topic: function() {
var callback = this.callback;
setTimeout(function() {
callback(new Error());
}, 100);
var vows = require('vows'),
assert = require('assert');
vows.describe('Buggy Test').addBatch({
'when async test returns error': {
topic: function() {
var callback = this.callback;
setTimeout(function() {
callback(new Error());
}, 100);
var vows = require('vows'),
assert = require('assert');
vows.describe('Buggy Test').addBatch({
'when async test returns error': {
topic: function() {
var callback = this.callback;
setTimeout(function() {
callback(new Error());
}, 100);
@gmiroshnykov
gmiroshnykov / test-http.js
Created June 3, 2011 15:34
Node.js HTTPS client bug
var http = require('http');
var server = http.createServer(function(req, res) {
req.on('end', function() {
var code = 204;
console.log('Sending status code: ' + code);
res.writeHead(code);
res.end();
});
});
@gmiroshnykov
gmiroshnykov / gist:1339141
Created November 4, 2011 11:28
Good luck with debugging...
$ node server.js
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
RangeError: Maximum call stack size exceeded
@gmiroshnykov
gmiroshnykov / spawn_vim.js
Created March 24, 2012 09:54
Spawn a child process and bind it to parent's stdin, stdout and stderr in node.js
var tty = require('tty'),
spawn = require('child_process').spawn;
var child = spawn('vim');
child.stdout.pipe(process.stdout);
child.stderr.pipe(process.stderr);
process.stdin.pipe(child.stdin);
process.stdin.resume();
tty.setRawMode(true);
#!/usr/bin/env bash
if [ -z "$RUBY_VERSION" ]; then
RUBY_VERSION='1.9.3-p327'
fi
which lsb_release > /dev/null
if [ $? -ne 0 ] || [ `lsb_release -s -i` != 'Ubuntu' ]; then
echo -e 'Sorry, this script only works in Ubuntu';
exit 1
INFO global: Vagrant version: 1.3.4
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.4/plugins/commands/box/plugin.rb
INFO manager: Registered plugin: box command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.4/plugins/commands/destroy/plugin.rb
INFO manager: Registered plugin: destroy command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.4/plugins/commands/halt/plugin.rb
INFO manager: Registered plugin: halt command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.4/plugins/commands/help/plugin.rb
INFO manager: Registered plugin: help command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.4/plugins/commands/init/plugin.rb