Skip to content

Instantly share code, notes, and snippets.

@amoose
amoose / searchkick_ext.rb
Created August 4, 2014 14:58
ElasticSearch synonym tokenization with Searchkick gem
require 'searchkick'
module SearchkickSyn
def searchkick_index_options
# fetch index options
options = super
# inject Synonym filter for default index and searchkick search
options[:settings][:analysis][:analyzer][:default_index][:filter].push "synonym"
options[:settings][:analysis][:analyzer][:searchkick_search][:filter].push "synonym"
@jordelver
jordelver / gist:3139365
Created July 18, 2012 22:29
How to write an image file to an SD card under Mac OS X (for Raspberry Pi)

Find the SD card device

In this case, the SD card is /dev/disk4. DO NOT get this wrong or you may destroy all the data on the wrong disk/card/drive.

diskutil list

/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *160.0 GB   disk0

1: EFI 209.7 MB disk0s1