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
require 'spec_helper' | |
describe "Searching" do | |
before(:each) do | |
visit root_path | |
end | |
before(:all) do | |
load_test_posts | |
end |
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
#Testing my full-text-search function. I do not have a submit button to submit my #query field but instead I only have the enter key press for it. | |
describe "will be successful" do | |
it "after the #query field is submitted by return button and the relevance of the value in the #query search_field_input is > 0%" do | |
result = Post.text_search(@question.title) | |
#fill_in 'query', with: "#{@question.title}\n" | |
Post.should_receive(:text_search).at_least(:once){ result } | |
visit root_path | |
page.should have_content @question.title | |
page.should have_css(".post-row", count: 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
%li{:class => "#{'active' if current_page?(root_path)}"}=link_to "Home", root_path |
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
find -wholename '*spec.rb' | xargs sed -i 's/shared.navbar.sign_in_with_fb_link.sign_in_with_facebook/shared.navbar.user_links.sign_in_with_fb_link.sign_in_with_facebook/g | |
find -wholename '*[rb][haml]&' | xargs sed -i 's/status_circle/status_indicator/g' |
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
#i.e you have Question object that has parent class Post | |
#say for example Post::SomeMethod returns true by default | |
@question = Question.create | |
#will fail | |
Post.any_instance.should_receive(:some_method).and_return false | |
@question.some_method.should eq false |
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
//Assume that the code base is really large. Say thousands of files. And you wanted to write on files involved to http://www.some.domain.com/membership/index.php | |
//This would be useful | |
find -name "index.htm" | ack-grep "membership" | |
find -name "index.php" | ack-grep "membership" | |
//Apply reg expressions to be more effective |
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
[07/Aug/2013 21:02:07] DEBUG [tastyapi.slum:13] Using slumber with user test, pointed at http://localhost:8000 | |
[07/Aug/2013 21:02:07] INFO [core.management.commands.update_repos:65] Building Pip | |
[07/Aug/2013 21:02:07] INFO [requests.packages.urllib3.connectionpool:191] Starting new HTTP connection (1): localhost | |
Traceback (most recent call last): | |
File "./manage.py", line 5, in <module> | |
execute_manager(settings.sqlite) | |
File "/home/deployer/apps/rtd/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 459, in execute_manager | |
utility.execute() | |
File "/home/deployer/apps/rtd/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute | |
self.fetch_command(subcommand).run_from_argv(self.argv) |
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
set tabline=%!MyTabLine() " custom tab pages line | |
function MyTabLine() | |
let s = '' " complete tabline goes here | |
" loop through each tab page | |
for t in range(tabpagenr('$')) | |
" set highlight | |
if t + 1 == tabpagenr() | |
let s .= '%#TabLineSel#' | |
else | |
let s .= '%#TabLine#' |
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
div.entry { | |
padding: 60px 90px 40px; | |
background: #fff; | |
} | |
div.published, | |
div.published a { | |
color: #aaa; | |
font-size: 12px; | |
} |
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
QUEUE=* RAILS_ENV=production bundle exec rake resque:work & | |
rake resque:work QUEUE='*' | |
RAILS_ENV=development rake resque:workers QUEUE=send_feddit_newsletters COUNT='3' | |
QUEUE=send_feddit_newsletters RAILS_ENV=production bundle exec rake resque:work COUNT='5' & | |
RAILS_ENV=production rake resque:workers QUEUE=send_feddit_newsletters COUNT='3' |
OlderNewer