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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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
source :gemcutter | |
gem 'goliath', :git => 'git://github.com/postrank-labs/goliath.git' | |
gem 'em-http-request', :git => 'git://github.com/igrigorik/em-http-request.git' | |
gem 'em-synchrony', :git => 'git://github.com/igrigorik/em-synchrony.git' | |
gem 'yajl-ruby' |
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
lsoave@ubuntu:~/rails/github/gitwatcher$ rails c | |
WARNING: Cucumber-rails required outside of env.rb. The rest of loading is being defered until env.rb is called. | |
To avoid this warning, move 'gem cucumber-rails' under only group :test in your Gemfile | |
MONGODB [DEBUG] Logging level is currently :debug which could negatively impact client-side performance. You should set your logging level no lower than :info in production. | |
MONGODB (0ms) admin['$cmd'].find({:ismaster=>1}).limit(-1) | |
Loading development environment (Rails 3.2.3) | |
1.9.2p290 :001 > class Category | |
1.9.2p290 :002?> category = ["ruby", "web", "framework"] | |
1.9.2p290 :003?> def self.find_competitors(category) | |
1.9.2p290 :004?> #Competitor = Struct.new(:html_url, :description, :user) |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Test JSONP search api</title> | |
<!--[if IE]> | |
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> | |
<![endif]--> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> | |
</head> |
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
$(document).ready(function() { | |
// Support for AJAX loaded modal window. | |
// Focuses on first input textbox after it loads the window. | |
$('[data-toggle="modal"]').click(function(e) { | |
e.preventDefault(); | |
var href = $(this).attr('href'); | |
if (href.indexOf('#') == 0) { | |
$(href).modal('open'); | |
} else { |
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 class="accordion-group"> | |
<div class="accordion-heading"> | |
</div> | |
<div class="accordion-body in collapse" id="collapse_id-1"> | |
<div class="accordion-body in collapse" id="collapse_id-2"> | |
<div class="accordion-body in collapse" id="collapse_id-3"> | |
... | |
<div class="accordion-group"> | |
<div class="accordion-heading"> |
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
# in application_helper | |
def flash_class(level) | |
case level | |
when :notice then "alert alert-info" | |
when :success then "alert alert-success" | |
when :error then "alert alert-error" | |
when :alert then "alert alert-error" | |
end | |
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
cd ~ | |
sudo apt-get update | |
sudo apt-get install openjdk-7-jre -y | |
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.0.tar.gz -O elasticsearch.tar.gz | |
tar -xf elasticsearch.tar.gz | |
rm elasticsearch.tar.gz | |
sudo mv elasticsearch-* elasticsearch | |
sudo mv elasticsearch /usr/local/share |
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
lsoave@ubuntu:~/rails/github/gitwatcher$ heroku run:detached rake environment tire:import CLASS=Event FORCE=true | |
Running rake environment tire:import CLASS=Event FORCE=true... up, run.2 | |
Use 'heroku logs -p run.2' to view the log output. | |
lsoave@ubuntu:~/rails/github/gitwatcher$ | |
2012-06-03T20:13:08+00:00 heroku[run.2]: State changed from created to starting | |
2012-06-03T20:13:13+00:00 heroku[run.2]: Starting process with command `bundle exec rake environment tire:import CLASS=Event FORCE=true` |
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
500 Internal Server Error after ElasticSearch query, which logs the following on Heroku: | |
2012-06-03T21:56:37+00:00 heroku[router]: GET gitwatcher.com/categories dyno=web.1 queue=0 wait=0ms service=10295ms status=200 bytes=61422 | |
2012-06-03T21:56:37+00:00 heroku[nginx]: 93.34.112.205 - - [03/Jun/2012:21:56:37 +0000] "GET /categories HTTP/1.1" 200 12068 "http://gitwatcher.com/" "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0" gitwatcher.com | |
2012-06-03T21:56:37+00:00 heroku[router]: GET gitwatcher.com/assets/application-02cfedf8524ef0a3da8856f66a3c61df.css dyno=web.1 queue=0 wait=0ms service=127ms status=200 bytes=178764 | |
2012-06-03T21:56:37+00:00 heroku[router]: GET gitwatcher.com/assets/application-4083955e163027c3e232b6edc9cf4dd1.js dyno=web.1 queue=0 wait=0ms service=88ms status=200 bytes=204559 | |
2012-06-03T21:56:37+00:00 heroku[nginx]: 93.34.112.205 - - [03/Jun/2012:21:56:37 +0000] "GET /assets/application-02cfedf8524ef0a3da8856f66a3c61df.css HTTP/1.1" 200 21098 "http://gitwatcher. |