Skip to content

Instantly share code, notes, and snippets.

View sixtus's full-sized avatar

Hagen Rother sixtus

View GitHub Profile
var http = require('http');
var client = http.createClient(81, 'localhost');
var request = client.request('GET', '/');
request.end();
request.on('response', function (response) {
console.log('STATUS: ' + response.statusCode);
console.log('HEADERS: ' + JSON.stringify(response.headers));
response.setEncoding('utf8');
response.on('data', function (chunk) {
console.log('BODY: ' + chunk);
task :populate_db do
begin
require 'rubygems'
require 'json'
require 'couchrest'
rescue
puts "Ruby gems missing, trying to install with sudo rights"
sh 'sudo gem install json couchrest'
retry
end