This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sidekiq::Queue.new('your_queue_name').latency | |
# => 10.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/ftp' | |
class FTPConnectionCreator | |
def self.call | |
ftp = Net::FTP.new(ENV['FTP_URL']) | |
ftp.login(ENV['FTP_USER'], ENV['FTP_PASSWORD']) | |
# ftp.chdir('public') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'time' | |
class Timer | |
def initialize(redis, time_key) | |
@redis = redis | |
@time_key = time_key | |
end | |
def get_last_call_time | |
time = @redis.get(@time_key) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'statsd-ruby' | |
statsd = Statsd.new 'localhost', 8125 | |
10.times do | |
statsd.increment 'hello.world' | |
sleep 1 | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
langs = { | |
'rb': 'ruby', | |
'js': 'javascript', | |
'py': 'python', | |
'c' : 'c', | |
'css' : 'css', | |
'html' : 'html', | |
'php': 'php', | |
'cpp': 'c++', | |
'rs': 'rust', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'json' | |
#CONFIG YOUR STUFF HERE | |
@in_development_issue_label = "em implementação" | |
@issues = 'https://api.github.com/repos/IgorMarques/ATM-Exercise/issues' | |
@issue_not_in_development_message = "MENSAGEM DE COMMIT INVÁLIDA: A issue referenciada não existe ou não está marcada como \"#{@in_development_issue_label}\"." |