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
db.hotels.find({hotel_name:/^Donovan House/, data_source: "TA"}) | |
{ "_id" : "TA-505", "hotel_class" : 4, "hotel_url" : "http://www.tripadvisor.com/Hotel_Review-g28970-d939976-Reviews-Donovan_House_A_Kimpton_Hotel-Washington_DC_District_of_Columbia.html", "updated" : ISODate("2012-06-04T03:00:24Z"), "review_total_list" : NumberLong(28), "overall_rating_list" : 3.5, "region" : "DC", "remote_id" : NumberLong(939976), "created" : ISODate("2012-03-06T20:55:04Z"), "street" : "1155 14th Street, N.W.", "city" : "Washington DC", "hotel_rank" : NumberLong(96), "postal_code" : "20005", "data_source" : "TA", "rank_area" : "Washington DC", "id" : NumberLong(505), "hotel_name" : "Donovan House - A Kimpton Hotel" } |
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 'mathn' | |
prime_array = [] | |
TARGET = 10001 | |
Prime.each do |prime| | |
if prime_array.size < TARGET | |
prime_array.push(prime) | |
else | |
break |
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 'rake/testtask' | |
Rake::TestTask.new do |t| | |
t.pattern = "test/*_test.rb" | |
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
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
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
[{"activity_date":"2012-10-10T19:09:29Z","activity_id":124069314,"activity_type":"Running","created_at":"2013-05-15T20:12:31Z","detail_present":true,"distance":10622.2704823343,"duration":3138.844,"id":1,"provider":"RunKeeper","run_detail":"---\n- timestamp: 0\n altitude: 51\n longitude: -77.044273\n latitude: 38.917912\n type: start\n- timestamp: 2.241\n altitude: 51\n longitude: -77.044273\n latitude: 38.917912\n type: gps\n- timestamp: 6.134\n altitude: 51\n longitude: -77.044295\n latitude: 38.917823\n type: gps\n- timestamp: 9.134\n altitude: 51\n longitude: -77.044271\n latitude: 38.917709\n type: gps\n- timestamp: 12.138\n altitude: 51\n longitude: -77.044229\n latitude: 38.917606\n type: gps\n- timestamp: 14.143\n altitude: 50.36363636363637\n longitude: -77.044154\n latitude: 38.917515\n type: gps\n- timestamp: 16.132\n altitude: 49.72727272727273\n longitude: -77.044095\n latitude: 38.91743\n type: gps\n- timestamp: 18.137\n altitude: 49.09090909090909\n longitude: -77. |
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
/*********************************************************************\ | |
* * | |
* epolys.js by Mike Williams * | |
* * | |
* A Google Maps API Extension * | |
* * | |
* Adds various Methods to GPolygon and GPolyline * | |
* * | |
* .Contains(latlng) returns true is the poly contains the specified * | |
* GLatLng * |
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
class ActivitiesController < ApplicationController | |
def show | |
@activity = Activity.find_by_activity_id(params[:id]) | |
path = @activity.run_detail["path"] | |
gon.stuff = path | |
render :layout => 'map' | |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Google Maps API Example: Simple Geocoding</title> | |
<script src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=AIzaSyBsmTCDQYlmID4H8rqVe7Gb9Nm_SMpHahA" type="text/javascript"></script> | |
<script type="text/javascript"> | |
var map = null; | |
var geocoder = null; |
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 'rubygems' | |
require 'neography' | |
def create_hero(name) | |
Neography::Node.create(name: name) | |
end | |
# Create heroes | |
wolverine = create_hero('Wolverine') | |
storm = create_hero('Storm') |
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
=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') |
OlderNewer