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
| { | |
| "title": "Logstash Search", | |
| "services": { | |
| "query": { | |
| "list": { | |
| "0": { | |
| "query": "*", | |
| "alias": "", | |
| "color": "#7EB26D", | |
| "id": 0, |
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
| $(document).ready(function(){ | |
| $("input#search").bindWithDelay("keyup", function() { | |
| term = $(this).val(); | |
| form = $(this).parent(); | |
| action = form.attr('action') + "?" + form.find('input[name!=utf8]').serialize(); | |
| if(term == '' || term.length >= 2){ | |
| $.get(action, null, null, 'script'); | |
| history.replaceState(null, "", action); | |
| } |
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
| irb(main):016:0> Person.where("soundex(first_name) LIKE soundex(?)", "%trinitya%") | |
| Person Load (16.9ms) SELECT `people`.* FROM `people` WHERE (soundex(first_name) LIKE soundex('%trinitya%')) | |
| => [#<Person id: 5, first_name: "Trinity", middle_name: nil, last_name: "Kuvalis", age: 22, email: "[email protected]", phone: "509-938-1572 x4260", address_1: "28790 Minerva Highway", address_2: nil, state: "PW", zip: 66274, contact_preference: nil, comments: "Natus porro aut itaque placeat sunt. Odio quas omni...", sources_of_interest: nil, other_sources_of_interest: nil, mailing_subscriptions: nil, lumbar_puncture: nil, study_partner: nil, study_partner_relationship: nil, adc_comments: "Sed porro blanditiis nemo. Sed facilis ea. Ea quis ...", created_at: "2012-05-04 19:53:05", updated_at: "2012-05-04 19:53:05", city: "East Clarissaburgh", active: true>] | |
| irb(main):017:0> Person.where("soundex(first_name) LIKE soundex(?)", "%trinityaa%") | |
| Person Load (0.4ms) SELECT `people`.* FROM `people` WHERE (soundex( |
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
| irb(main):005:0> Person.search("Trinity") | |
| Person Load (0.4ms) SELECT `people`.* FROM `people` WHERE (last_name LIKE '%Trinity%' OR first_name LIKE '%Trinity%' OR id = 'Trinity' OR email LIKE '%Trinity%') | |
| => [#<Person id: 5, first_name: "Trinity", middle_name: nil, last_name: "Kuvalis", age: 22, email: "[email protected]", phone: "509-938-1572 x4260", address_1: "28790 Minerva Highway", address_2: nil, state: "PW", zip: 66274, contact_preference: nil, comments: "Natus porro aut itaque placeat sunt. Odio quas omni...", sources_of_interest: nil, other_sources_of_interest: nil, mailing_subscriptions: nil, lumbar_puncture: nil, study_partner: nil, study_partner_relationship: nil, adc_comments: "Sed porro blanditiis nemo. Sed facilis ea. Ea quis ...", created_at: "2012-05-04 19:53:05", updated_at: "2012-05-04 19:53:05", city: "East Clarissaburgh", active: true>] |
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
| config.action_mailer.delivery_method = :sendmail | |
| config.action_mailer.sendmail_settings = { | |
| :openssl_verify_mode => 'none' | |
| } |
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
| FactoryGirl.define do | |
| factory :user do | |
| first_name { Faker::Name.first_name } | |
| last_name { Faker::Name.last_name } | |
| email { Faker::Internet.email } | |
| password 'password' | |
| end | |
| 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
| ==> Output of top: | |
| top - 21:34:56 up 127 days, 18:56, 2 users, load average: 5.36, 5.71, 5.73 | |
| Tasks: 184 total, 7 running, 176 sleeping, 1 stopped, 0 zombie | |
| Cpu(s): 98.3%us, 1.7%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st | |
| Mem: 4050600k total, 3793036k used, 257564k free, 525688k buffers | |
| Swap: 2096440k total, 564808k used, 1531632k free, 1518568k cached | |
| PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND | |
| 29524 strokecd 25 0 763m 55m 2876 R 49.2 1.4 351:20.02 ruby |
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
| it "should redirect to the movie index when no similar movies exist" do | |
| @movie = mock('Movie') | |
| @movie.stub(:id).and_return(1) | |
| Movie.should_receive('find_similar').with(@movie.id).and_return(nil) | |
| get 'similar', {:id => @movie.id} | |
| response.should redirect_to(movies_path) | |
| 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
| require 'spec_helper' | |
| describe MoviesController do | |
| before :each do | |
| @movie = Movie.create(:title => 'American Graffiti', :rating => 'R', :release_date => "1973-08-11", :director => "George Lucas") | |
| end | |
| describe 'Find similar movies' do | |
| it "has a route defined to show similar movies" do | |
| get 'similar', {:id => @movie.id} |
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
| require 'spec_helper' | |
| describe MoviesController do | |
| before :each do | |
| @movie = Movie.create(:title => 'American Graffiti', :rating => 'R', :release_date => "1973-08-11", :director => "George Lucas") | |
| end | |
| describe 'Find similar movies' do | |
| it "has a route defined to show similar movies" do | |
| get 'similar', {:id => @movie.id} |
NewerOlder