Skip to content

Instantly share code, notes, and snippets.

Vojtěch Hýža vhyza

Block or report user

Report or block vhyza

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View carrierwave-blob.gemspec
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = "carrierwave-blob"
s.version = "0.0.1"
s.platform = Gem::Platform::RUBY
s.summary = "BLOB support for Carrierwave"
s.authors = [ 'Karel Minarik', 'Vojtech Hyza' ]
s.email = [ 'karmi@karmi.cz', 'vhyza@vhyza.eu' ]
@vhyza
vhyza / 1_terms_vector_test.sh
Last active Dec 18, 2015
terms vector test
View 1_terms_vector_test.sh
echo "[!] delete twitter index"
curl -XDELETE 'http://localhost:9200/twitter/' ; echo
echo "[*] create twitter index"
curl -XPUT 'http://localhost:9200/twitter/' -d '{
"mappings": {
"tweet": {
"properties": {
"text": {
"type": "string",
View .gitignore
.DS_Store
Gemfile.lock
*.pem
node.json
tmp/*
!tmp/.gitignore
@vhyza
vhyza / es-czech-analyzer.rb
Created May 21, 2012
Elasticsearch czech analyzer test
View es-czech-analyzer.rb
require 'rubygems'
require 'tire'
class Article
include Tire::Model::Persistence
# Jen zmena nazvu indexu at nahodou nesmazes nejaky svuj existujici 'articles' index
#
@vhyza
vhyza / tire_228.rb
Created Feb 6, 2012
Tire issue #228
View tire_228.rb
require 'tire'
Tire.index 'users_tire_issue' do
delete
create mappings: {
user: {
properties: {
email: { type: 'string' },
names: { type: 'string', analyzer: 'snowball' },
medical_conditions: {
@vhyza
vhyza / filtered.rb
Created Dec 20, 2011
Tire filtered query test
View filtered.rb
require 'tire'
Tire.configure do
logger STDERR
end
Tire.index 'filtered_test' do
delete
create
store tags: ['ruby'], content: 'is awesome'
@vhyza
vhyza / catch_exception.rb
Created Nov 10, 2011
Removed require 'cgi' to avoid segmentation fault
View catch_exception.rb
# encoding: utf-8
STDOUT.sync = true
STDERR.sync = true
require 'pathname'
at_exit do
if (e = $!) && !e.instance_of?(SystemExit)
require "#{ENV['TM_SUPPORT_PATH']}/lib/escape"
@vhyza
vhyza / es_fields_test.sh
Created Jun 10, 2011
Elasticsearch fields test
View es_fields_test.sh
# Remove index
curl -s -XDELETE "http://localhost:9200/fields_test"
# Set new index with mapping
curl -s -XPUT "http://localhost:9200/fields_test" -d '
{
"mappings": {
"tweet" : {
"properties" : {
View elastic_search_multi_field_search.sh
# ========================================
# Testing multiple analyzers per field
# ========================================
# Setup
curl -s -X DELETE 'http://localhost:9200/news_test/'
# Create index with settings and mapping
curl -s -X PUT 'http://localhost:9200/news_test' -d '
{
You can’t perform that action at this time.