Answer the question
In order to leave comments, you need to log in
How to complete an array (hash) by condition in Ruby?
For example, there is an array:
list = [
{ 'name': 'Аntonello', num: 3 }
{ 'name': 'Sergello', num: 5 }
{ 'name': 'Аntonello', num: 3 }
]
list = [
{ 'name': 'Аntonello', count: 2 }
{ 'name': 'Sergello', count: 1 }
]
Answer the question
In order to leave comments, you need to log in
var http = require('http');
var phantom = require('phantom');
var app = http.createServer(function (req,res) {
res.writeHead(200);
res.write("Hello world");
phantom.create(function (ph) {
ph.createPage(function (page) {
page.open('http://google.com/', function() {
console.log('create screen');
page.render('google.png');
});
});
});
res.end();
}).listen(8080);
console.log("listening on 8080");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question