This file contains hidden or 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
context "Validates presence of either start time or open time" do | |
setup do | |
@user = FactoryGirl.create(:user) | |
@account = FactoryGirl.create(:account, user: @user) | |
@location = FactoryGirl.create(:location, account: @account) | |
end | |
should "not be valid without open time or start time " do | |
event = FactoryGirl.build(:event, fb_id: '12345', account: @account, location: @location, start_at: nil, open_at: nil, end_at: Time.now + 1.hour) | |
assert !event.valid? |
This file contains hidden or 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
context "Validates presence of either start time or open time" do | |
setup do | |
@user = FactoryGirl.create(:user) | |
@account = FactoryGirl.create(:account, user: @user) | |
@location = FactoryGirl.create(:location, account: @account) | |
end | |
should "not be valid without open time or start time " do | |
event = FactoryGirl.build(:event, fb_id: '12345', account: @account, location: @location, start_at: nil, open_at: nil, end_at: Time.now + 1.hour) | |
assert !event.valid? |
This file contains hidden or 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
{"first_name":"Tomek","last_name":"K","avatar_url":null,"short_address":"Brandenburg, Germany","user_url":"/users/user5-el","pending_friendships":[{"agripoints":0,"avatar_content_type":null,"avatar_file_name":null,"avatar_file_size":null,"avatar_updated_at":null,"confirmation_reminder":false,"created_at":"2013-06-11T14:17:51Z","deals_newsletter":false,"email":"[email protected]","first_name":"User5","id":20,"language":"English","last_name":"El","newsletter":false,"slug":"user5-el","terms_of_service":true,"title":"Mr","updated_at":"2013-06-11T14:17:51Z","user_type":"Farmer","website":"http:\\codequest.com"}]} |
This file contains hidden or 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
#encoding: utf-8 | |
def fetch_job_links | |
job_links = [] | |
if next_page_selector | |
index_doc = Nokogiri::HTML(open(url)) | |
base_url = parse_base_url(url, index_doc) | |
pagination = index_doc.at_xpath(next_page_selector) | |
next_page_link = URI.join(base_url, pagination['href']).to_s rescue nil | |
##przed tą pętlą ustawia mi się next_page_link na nila, wiesz może dlaczego? |
This file contains hidden or 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
$ rescue rails s | |
This file contains hidden or 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
$ rescue rspec |
This file contains hidden or 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
From: /home/przemek/Projects/dirble/spec/station_spec.rb @ line 20 : | |
15: station = Dirble::Station.by_continent('Asia').first | |
16: expect(station.name).to eq('Lounge Beats') | |
17: end | |
18: | |
19: it 'returns station filtered by country using iso code' do | |
=> 20: station = Dirble::Station.by_country_code('us').first | |
21: expect(station.country).to eq('US') | |
22: end |
This file contains hidden or 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 PUT localhost:9200/books -d ' | |
{ | |
"settings" : { | |
"index" : { | |
"analysis" : { | |
"analyzer" : { | |
"autocomplete_analyzer" : { | |
"type" : "custom", | |
"tokenizer" : "lowercase", |
This file contains hidden or 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 -XGET 'localhost:9200/events/_analyze?pretty' -H 'Content-Type: application/json' -d' | |
{ | |
"normalizer" : "sortable", | |
"text" : "Triathlon race " | |
} | |
' | |
curl -XPUT 'localhost:9200/events/' -H 'Content-Type: application/json' -d' | |
{ | |
"settings": {"analysis":{"filter":{"ngram_small_filter":{"type":"nGram","min_gram":2,"max_gram":5},"ngram_medium_filter":{"type":"nGram","min_gram":3,"max_gram":20}},"analyzer":{"index_ngram_small_analyzer":{"type":"custom","tokenizer":"standard","filter":["lowercase","ngram_small_filter"]},"index_ngram_medium_analyzer":{"type":"custom","tokenizer":"standard","filter":["lowercase","ngram_medium_filter"]},"search_standard_analyzer":{"type":"custom","tokenizer":"standard","filter":["lowercase"]}},"normalizer":{"sortable":{"type":"custom","char_filter":[],"filter":["lowercase"]}}}}, |
This file contains hidden or 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
launchctl unload /Users/przemyslawmroczek/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist | |
launchctl remove /Users/przemyslawmroczek/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist | |
rm /Users/przemyslawmroczek/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist | |
brew services stop elasticsearch | |
brew uninstall elasticsearch |
OlderNewer