Skip to content

Instantly share code, notes, and snippets.

View edipofederle's full-sized avatar
🏠
Working from home

Édipo Féderle edipofederle

🏠
Working from home
View GitHub Profile
import org.junit.Test;
import arquitetura.builders.ArchitectureBuilder;
import arquitetura.representation.Architecture;
import arquitetura.representation.Class;
import arquitetura.representation.Concern;
import mestrado.arquitetura.factories.Klass;
public class Main {
##################### Elasticsearch Configuration Example #####################
# This file contains an overview of various configuration settings,
# targeted at operations staff. Application developers should
# consult the guide at <http://elasticsearch.org/guide>.
#
# The installation procedure is covered at
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
#
# Elasticsearch comes with reasonable defaults for most settings,
Resetting OrderIndex
Imported OrderIndex::Order for 264.13s, documents total: 4000
rake aborted!
Faraday::TimeoutError: Net::ReadTimeout
/Users/edipo/.rvm/gems/ruby-2.1.1/gems/aws-sdk-v1-1.64.0/lib/aws/core/http/patch.rb:29:in `block in new_transport_request'
/Users/edipo/.rvm/gems/ruby-2.1.1/gems/aws-sdk-v1-1.64.0/lib/aws/core/http/patch.rb:26:in `catch'
/Users/edipo/.rvm/gems/ruby-2.1.1/gems/aws-sdk-v1-1.64.0/lib/aws/core/http/patch.rb:26:in `new_transport_request'
/Users/edipo/.rvm/gems/ruby-2.1.1/gems/newrelic_rpm-3.14.0.305/lib/new_relic/agent/instrumentation/net.rb:27:in `block (2 levels) in request_with_newrelic_trace'
/Users/edipo/.rvm/gems/ruby-2.1.1/gems/newrelic_rpm-3.14.0.305/lib/new_relic/agent.rb:431:in `disable_all_tracing'
/Users/edipo/.rvm/gems/ruby-2.1.1/gems/newrelic_rpm-3.14.0.305/lib/new_relic/agent/instrumentation/net.rb:26:in `block in request_with_newrelic_trace'
//Na classe Architecture.java tem o seguinte método:
/**
* Retorna um Map imutável. É feito isso para garantir que nenhum modificação seja feita diretamente na lista
*
* Set<Package>
*
* @return Set<Package>
*/
public Set<Package> getAllPackages() {
class OrderPdf
def initialize(order, user)
@order = order
@user = user
@view = ActionView::Base.new(ActionController::Base.view_paths, {})
@view.extend(ApplicationHelper)
@view.extend(AbstractController::Rendering)
@view.extend(Rails.application.routes.url_helpers)
@save_path = Rails.root.join('public','filename.pdf')
end
module Modules
class OrderPdf
include ActionView::Rendering
def initialize(order)
@order = order
@view = ActionView::Base.new(ActionController::Base.view_paths, {})
@view.extend(ApplicationHelper)
@view.extend(AbstractController::Rendering)
@view.extend(Rails.application.routes.url_helpers)
;; Testando somente o server side funciona OK.
curl -X POST -d "foo=bar" http://localhost:10555/posts
Params: {:foo "bar"}%
;; Client Side
(def ^:private meths
{:get "GET"
:put "PUT"
:post "POST"
:delete "DELETE"})
# Funciona perfeitamente bem
<% cache "tags", skip_digest: true do %>
<% current_user.tags.each do |tag| %>
<%= tag.name %>
<% end %>
<% end %>
# Simplesmente não renderiza nada
<% cache "tags_#{current_user.id}", skip_digest: true do %>
Elasticsearch::Transport::Transport::Errors::BadRequest ([400] {"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[iHG-FZ9ITQe81q-353LKWQ][order_1437597819549][2]: SearchParseException[[order_1437597819549][2]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"bool\":{\"must\":[{\"query_string\":{\"fields\":[\"company_id\"],\"query\":94}},{\"query_string\":{\"fields\":[\"client_name_order\",\"client_email_order\",\"id\",\"order_id\"],\"query\":\"teste\",\"default_operator\":\"or\"}}]}},\"sort\":[{\"created_at\":\"desc\"}],\"size\":900000}]]]; nested: NumberFormatException[For input string: \"teste\"]; }{[iHG-FZ9ITQe81q-353LKWQ][order_1437597819549][1]: SearchParseException[[order_1437597819549][1]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\"query\":{\"bool\":{\"must\":[{\"query_string\":{\"fields\":[\"company_id\"],\"query\":94}},{\"query_string\":{\"fields\":[\"client_name_order\",\"client_email_order\",\"id\",\"o
# Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
# You can use `rake secret` to generate a secure secret key.
# Make sure the secrets in this file are kept private