Skip to content

Instantly share code, notes, and snippets.

@chytreg
chytreg / application.rb
Created July 12, 2012 09:17
Rails polish pluralization settings
# inside class Application < Rails::Application block
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
@chytreg
chytreg / gist:2953702
Created June 19, 2012 11:47
Analyzer failed to find filter under name [polish]
[2012-06-19 13:42:16,472][WARN ][cluster.metadata ] [Hydron] [test] failed to create
org.elasticsearch.indices.IndexCreationException: [test] failed to create index
at org.elasticsearch.indices.InternalIndicesService.createIndex(InternalIndicesService.java:288)
at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService$1.execute(MetaDataCreateIndexService.java:242)
at org.elasticsearch.cluster.service.InternalClusterService$2.run(InternalClusterService.java:211)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.IllegalArgumentException: Custom Analyzer [default] failed to find filter under name [polish]
at org.elasticsearch.index.analysis.CustomAnalyzerProvider.build(CustomAnalyzerProvider.java:75)
@chytreg
chytreg / active_resource_connection.rb
Created March 26, 2012 12:14
Active Resource with ConditionalGet using wrest and dalli gems.
require 'wrest'
require 'dalli'
module Wrest::Caching
class Memcached
def initialize(server_urls=nil, options={})
@memcached = Dalli::Client.new(server_urls, options)
end
@chytreg
chytreg / TODO
Created August 3, 2011 17:51
hjs sprocket template, put in your rails3 app as initializer
- puts this in application.rb
# Sprockets::HjsTemplate
Sprockets.register_engine '.hjs', Sprockets::HjsTemplate
- add those gems in Gemfile:
gem 'haml'
gem 'eco'