This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FlioDefaults { | |
enum Key: String { | |
case unloggedUserVouchers = "FLIOUnloggedUserVouchers" | |
case sentCalendarEvents = "FLIOSentCalendarEventsKey" | |
case recentSearchAirportIds = "recentAirportSearchUIDs" | |
case calendarPermissionsGranted = "FLIOcalendarPermissionsGranted" | |
case calendarPermissionsRequested = "FLIOcalendarPermissionsRequested" | |
} | |
// static let foo = NativeProperty<String>(.testKey, default: "foo") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
initArticleImages: -> | |
@element.find(".article__body img").each -> | |
self = $(@) | |
if alt = self.attr("alt") | |
wrapper_div = $('<div></div>').addClass(self.attr("class")) | |
self.attr("class", "") | |
wrapper_div.appendTo(self.parent("p")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run with: rake environment elasticsearch:reindex | |
namespace :elasticsearch do | |
desc "re-index elasticsearch" | |
task :reindex => :environment do | |
klass = Place | |
ENV['CLASS'] = klass.name | |
ENV['INDEX'] = new_index = klass.tire.index.name << '_' << Time.now.strftime('%Y%m%d%H%M%S') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:seasons => [ | |
{ | |
:from => 20010101, | |
:to => 20120101, | |
:price => 75, | |
:weekend_price => 100 | |
}, | |
{ | |
:from => 20120102, | |
:to => 20150101, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X GET "http://localhost:9200/development_places/place/_search?pretty=true" -d ' | |
{ | |
"query" : { | |
"filtered" : { | |
"query" : { | |
"custom_score" : { | |
"query" : { | |
"match_all":{} | |
}, | |
"script" : "_source.search_ranking * -1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X GET "http://localhost:9200/development_places/place/_search?pretty=true" -d ' | |
{ | |
"query" : { | |
"custom_score" : { | |
"query": { | |
"filtered" : { | |
"query" : {"match_all":{}}, | |
"filter" : [ | |
{ | |
"and" : [ {"geo_bounding_box":{"location":{"top_left":[13.0535,52.6675],"bottom_right":[13.7262,52.3303]}}},{"range":{"number_of_beds":{"gte":2}}}] |