+----------+ +------------+
|users | |tasks |
+----------+ +------------+
|*email | /|*name |
|first_name+------------+description |
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
# This file was generated by the `rails generate rspec:install` command. Conventionally, all | |
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. | |
# The generated `.rspec` file contains `--require spec_helper` which will cause this | |
# file to always be loaded, without a need to explicitly require it in any files. | |
# | |
# Given that it is always loaded, you are encouraged to keep this file as | |
# light-weight as possible. Requiring heavyweight dependencies from this file | |
# will add to the boot time of your test suite on EVERY test run, even for an | |
# individual file that may not need all of that loaded. Instead, make a | |
# separate helper file that requires this one and then use it only in the specs |
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
# This file is copied to spec/ when you run 'rails generate rspec:install' | |
ENV["RAILS_ENV"] ||= 'test' | |
require 'spec_helper' | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' | |
# Requires supporting ruby files with custom matchers and macros, etc, in | |
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are | |
# run as spec files by default. This means that files in spec/support that end | |
# in _spec.rb will both be required and run as specs, causing the specs to be |
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_relative 'helper' | |
# example call: | |
# breweries = BeerMappingProject.new.city_search("Boston") | |
# breweries is an array of Brewery objects | |
class BeerMappingProject | |
include HTTParty | |
base_uri 'http://beermapping.com/webservice' |
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 'ruby-progressbar' | |
progress = ProgressBar.create(format: '%a %bᗧ%i %p%% %t', | |
progress_mark: ' ', | |
remainder_mark: '・', | |
starting_at: 1) | |
99.times do | |
sleep(0.1) | |
progress.increment |
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
// GongHitter | |
// by Vikram and Richard | |
#include <Servo.h> | |
int STEP = 5; | |
int DELAY = 500; | |
unsigned long TIME_BETWEEN_HITS = 3600000; // one hour | |
//1000 * 60 * 60 * 24; |
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
# routes.rb | |
get 'search' => 'search#index' | |
# search_controller.rb | |
class SearchController < ApplicationController | |
def index | |
@kitchens = Kitchen.where("city ilike ?", "%#{params[:q]}%") | |
@meals = Meal.where("name ilike ?", "%#{params[:q]}%") | |
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 'httparty' | |
require 'cgi' | |
require 'dotenv' | |
require_relative 'brewery' | |
Dotenv.load | |
# example call: | |
# breweries = BeerMappingProject.new.city_search("Boston") | |
# breweries is an array of Brewery objects |
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
# gem install rack | |
# gem install thin | |
require 'rack' | |
require 'rack/lobster' | |
# Rack::Builder allows us to glue together various Rack middlewares | |
# together to form a single application | |
# The webapp proc, which responds to the #call method, must return |
Install rspec, rspec-core, rspec-expectations, rspec-mocks, rspec-support
OlderNewer