Skip to content

Instantly share code, notes, and snippets.

View antico5's full-sized avatar

Armando Andini antico5

  • Santa Fe, Argentina
View GitHub Profile
@antico5
antico5 / armando.rb
Created June 5, 2014 00:56
Armando bot
class Predictor
attr_accessor :ticks, :enemies, :bot
def initialize bot
@ticks = 0
@enemies = {}
@bot = bot
end
def predict_coordinates &b
@antico5
antico5 / transactionlogs
Last active August 29, 2015 14:02
Transaction logs a crear
name:
RFIDTagID
value:
params[:rfid]
action:
REQUEST
cuando:
en ProcessController#rfid_input
name:
@antico5
antico5 / gist:f1a329a8379062cbd463769f33c4ba86
Created December 27, 2016 18:04
Sidekiq on production

##YML

sidekiq.yml
---
:verbose: false
:concurrency: 10
:pidfile: tmp/pids/sidekiq.pid
:queues:
  - [critical, 2]
  - default

gem 'sidekiq-cron'

config/initializers/sidekiq.rb

Sidekiq.configure_server do |config|
  config.redis = { url: 'redis://localhost:6379/0'  }
  schedule_file = "config/schedule.yml"
  if File.exists?(schedule_file)
    Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule_file)
 end
@antico5
antico5 / time_travel.rb
Created January 3, 2017 14:24
time travel
require 'rails_helper'
include ActiveSupport::Testing::TimeHelpers
describe TimeTravel do
it 'allows person to answer after 1 day' do
expect(person_can_answer).to be_falsey
# About to go to the future
travel(1.day) do
# While in the future
expect(person_can_answer).to be_truthy
upstream project {
server 22.22.22.2:3000;
server 22.22.22.3:3000;
server 22.22.22.5:3000;
}
server {
listen 80;
location / {
@antico5
antico5 / unicorn guide.md
Last active March 20, 2017 17:05
unicorn config

Install unicorn gem

  gem 'unicorn'

Make config/unicorn.rb

# set path to application
app_dir = File.expand_path("../..", __FILE__)
@antico5
antico5 / Capybara.md
Created April 7, 2017 15:53 — forked from tomas-stefano/Capybara.md
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
@antico5
antico5 / rails gmail
Created May 29, 2017 14:13
rails gmail
http://www.google.com/accounts/DisplayUnlockCaptcha
https://www.google.com/settings/security/lesssecureapps
0x1D66E3e60aA606c6912abC93674fEdfB41CbfA42