- Alda Rocha: Mulheres que falam e palestram
- Alex Braha Stoll: Ruby + Rust
- Anderson Dias: 3B de jobs no Sidekiq
- Andre Luis Anastacio: Effective Rails Instrumentation
- Artur Caliendo Prado: Grafana, StatsD e InfluxDB
- Bruno Alves: Arquitetura de micro serviços
- Camila Campos: Como não escrever seus testes
- Charlotte Lorelei Oliveira: [Tolerância a falhas com supervisor trees em Elixir](https://docs.google.com/presentation/d/e/2PACX-1vT8eAiVAgK5_aHBduO-P2Cb1QbeaX4DyvHAsDbgfKOt0lDVBEl4Qm_KeCx7mNGn7PS16gMgZ-ffLkrO/pub?start=false&loop=fa
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
# RAILS 2.3.15 | |
# | |
# Since <tag type="yaml"> was removed from rails' xml parsing, | |
# but not from its to_xml method, rails can't talk to an API | |
# generated by rails, if you have serialized attributes. | |
# This can be put in config/initializers and you should probably | |
# upgrade to rails 3 already. Ugh. | |
# Three parts: |
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
# http://redis.io/commands/rpoplpush | |
module Resque | |
def self.move_queue(source, destination) | |
r = Resque.redis | |
r.llen("queue:#{source}").times do | |
r.rpoplpush("queue:#{source}", "queue:#{destination}") | |
end | |
end | |
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
ruby -e 'z=0x1F551;->(c,&b){loop{c.each(&b)}}.(11.times.map{|i|[z+i].pack("U")}){|m|print "#{"\b"*3}#{m} ";sleep 0.1}' |
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 | |
# .git/hooks/pre-commit | |
# Git pre-commit hook that catches errors that I commonly make. | |
# | |
# To intentionally ignore the hook (i.e., when adding an alert call), commit | |
# from the command line with "--no-verify" | |
# | |
# Loosely based on Henrik Nyh's <http://henrik.nyh.se> work (2011-10-08) | |
# under the MIT License. |
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
source 'https://rubygems.org' | |
gem 'rake' | |
gem 'lotus-router' | |
gem 'lotus-controller' | |
gem 'lotus-view' | |
group :test do | |
gem 'rspec' | |
gem 'capybara' |
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
desc 'rolls back migrations in current branch not present in other' | |
task :rollback_branch_migrations, [:other_branch] do |t, args| | |
load "#{Dir.pwd}/Rakefile" | |
branch_migrations = BranchMigrations.new(args.other_branch) | |
puts ['Rollback the following migrations', branch_migrations, 'y,n? '] | |
next if %w[no n NO N].include?(STDIN.gets.chomp) | |
Rake::Task['environment'].invoke |
Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.
Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.
- Get an OAuth Token from GitHub
First you will need to get an OAuth Token from GitHub using your own username and "note"
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
>> IF = -> b { b } | |
=> #<Proc:0x007fb4e4049cc8 (lambda)> | |
>> LEFT = -> p { p[-> x { -> y { x } } ] } | |
=> #<Proc:0x007fb4e403d680 (lambda)> | |
>> RIGHT = -> p { p[-> x { -> y { y } } ] } | |
=> #<Proc:0x007fb4e4028ff0 (lambda)> | |
>> IS_EMPTY = LEFT |
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
class Mecha | |
private attr_accessor(:states_map, :callbacks, :transitions, :current_state) | |
public :transitions, :current_state | |
def initialize(initial_state:, transitions:) | |
self.states_map = transitions.parameters.select { |(type, _)| type == :keyreq }.to_h { [_2, _2] } | |
self.callbacks = Hash.new { |hash, key| hash[key] = [] } | |
self.transitions = transitions.call(**states_map).transform_values(&:freeze).freeze |
OlderNewer