Yusuke ENDOH writes:
Periodically when fetching web pages using open-uri, he notices that many different kinds of exceptions can be raised.
So far, he’s experienced these below:
-
Errno::ETIMEDOUT
| require 'benchmark/ips' | |
| h = { foo: :bar } | |
| Benchmark.ips do |r| | |
| r.report('#[]') { h[:foo] } | |
| r.report('#fetch') { h.fetch(:foo) } | |
| end |
Yusuke ENDOH writes:
Periodically when fetching web pages using open-uri, he notices that many different kinds of exceptions can be raised.
So far, he’s experienced these below:
Errno::ETIMEDOUT
| class ApplicationController < ActionController::Base | |
| protect_from_forgery | |
| after_filter :set_access_control_headers | |
| def set_access_control_headers | |
| headers['Access-Control-Allow-Origin'] = '*' | |
| headers['Access-Control-Request-Method'] = '*' | |
| end | |
| end |
| [cmilfont@milfont:/Users/cmilfont/projetos/forteschat3/oraculo:homologacao:a1a293f:+M] | |
| $ rspec spec/integration/chamado_spec.rb -e "Deveria submeter a dúvida para a tela de Faqs" | |
| Run filtered including {:full_description=>/(?-mix:Deveria\ submeter\ a\ dúvida\ para\ a\ tela\ de\ Faqs)/} | |
| Chamado | |
| Como cliente | |
| Pagina inicial | |
| DEPRECATION WARNING: <% %> style block helpers are deprecated. Please use <%= %>. (called from _app_views_chamados_index_html_erb__1905729048714370975_2183758900_2238918427965469768 at /Users/cmilfont/projetos/forteschat3/oraculo/app/views/chamados/index.html.erb:40) | |
| http://127.0.0.1:51920/javascripts/vendor/jquery-1.7.1.min.js:4 TypeError: Result of expression 'o' [null] is not an object. | |
| Deveria submeter a dúvida para a tela de Faqs (FAILED - 1) |
| gem 'mongo' | |
| gem 'em-mongo' | |
| gem 'bson_ext' | |
| gem 'goliath' | |
| gem 'grape' |
| gem 'mongo' | |
| gem 'em-mongo' | |
| gem 'bson_ext' | |
| gem 'goliath' | |
| gem 'grape' |
| class CardCreator < Struct.new(:listener) | |
| def create(iteration, attributes) | |
| card = iteration.cards.build(attributes) | |
| if card.save | |
| listener.created(card) | |
| else | |
| listener.create_failed(card) | |
| end | |
| end | |
| end |
| config['mongo'] = EventMachine::Synchrony::ConnectionPool.new(size: 20) do | |
| conn = EM::Mongo::Connection.new('localhost', 27017, 1, {:reconnect_in => 1}) | |
| conn.db('muisco') | |
| end |
| Sete Atitudes para Hackear a Indústria de Software | |
| By Klaus Wuestefeld | |
| 1) Torne-se excelente. | |
| Seja realmente bom em alguma coisa. Não fique só choramingando ou | |
| querendo progredir às custas dos outros. Não pense q pq vc sentou 4 | |
| anos numa faculdade ouvindo um professor falar sobre software q vc | |
| sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo |
Dear Rubyists,
I just lost a contract because of my code in a Rails project.
The specific code in question is related to a "posting a comment" feature. Here are the details:
In this project, "posting a comment" does not simply entail inserting a row into the database. It involves a procedure to yes, insert a row, but also detect its language, check for spam, send emails, and "share" it to Twitter and Facebook. I believe this algorithm should be encapsulated. I do not believe it belongs in a controller or a model. I do not believe Active Record callbacks should be used.
The "senior developer", whom is the stake holder's right hand man, said this: