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
import React, { Component } from 'react'; | |
import Candidate from './Candidate.js'; | |
import Button from 'react-uikit-button'; | |
export default class CandidateList extends Component { | |
constructor(props) { | |
super(props); | |
this.handleClick = this.handleClick.bind(this) | |
} |
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
import React, { Component } from 'react'; | |
import CandidateList from './Views/CandidateList.js'; | |
import Candidate from './Views/Candidate.js'; | |
import fetch from 'isomorphic-fetch'; | |
import { Route, Switch } from "react-router-dom"; | |
class ParentComponent extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { |
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
$(‘.myClass’) |
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
$(‘form’).on(“submit”, function (e) { | |
e.preventDefault(); | |
alert(“Your form has been submitted.”); | |
}) |
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 jquery | |
//= require jquery_ujs | |
//= require turbolinks | |
//= require_tree . | |
//= require card | |
//= require decks |
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
# 2) Write a function that takes a list of integers and returns the odd numbers. | |
class Odd | |
def return_odd(int_array) | |
odd_ints = int_array.select { |int| int % 2 == 1 } | |
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
class Attraction < ActiveRecord::Base | |
has_many :rides | |
has_many :users, through: :rides | |
validates_presence_of :name, :min_height, :nausea_rating, :happiness_rating, :tickets | |
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
module AirBnbMod | |
module InstanceMethods | |
end | |
module ClassMethods | |
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 './config/environment' | |
class ApplicationController < Sinatra::Base | |
helpers do | |
def logged_in? | |
!!session[:id] | |
end | |
def current_user |
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' | |
RSpec.describe WikinewsScraper::Article do | |
# If the fixtures are deleted or VCR generates new cassettes these tests | |
# will have to be updated based on current values from: | |
# https://en.wikinews.org/wiki/Main_Page as well as one of the articles linked | |
# from the day's headlines. | |
describe '#scrape_articles' do | |
it 'scrapes the main page of Wikinews' do | |
VCR.use_cassette("main_page") do |