Skip to content

Instantly share code, notes, and snippets.

//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
@brunopedroso
brunopedroso / robot.js
Created December 6, 2012 19:55
DOJOBOT
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
this.state = 'procurando';
this.voltadas = 0
};
Robot.prototype.onIdle = function(ev) {
@brunopedroso
brunopedroso / robot.js
Created December 13, 2012 19:51 — forked from jaskolek/robot.js
jaskolek
var robots = new Array();
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.start = function( ev ){
let profilesIntoConversation = this.get('currentProfile.conversations').reduce((profilesByConversation, currentConversation) => {
profilesByConversation.push({
conversation: currentConversation,
profiles: currentConversation.get('participants').filter((participant) => {
return (this.removeAccents(participant.get('name').toLowerCase()).indexOf(filter) !== -1
|| participant.get('phone').indexOf(filter) !== -1)
&& participant.get('remotoAddress') !== this.get('currentProfile.remotoAddress');
})
});
return profilesByConversation;
==== limpar resque
Resque::Failure.count
a = Resque::Failure.all(0,50); nil
lista = []
a.each_with_index do |x,i|
if x['payload']['args'].first['queue_name'] == 'salary_stub_load_job'
lista << i
end