Skip to content

Instantly share code, notes, and snippets.

View lizdenhup's full-sized avatar

Liz Denhup lizdenhup

  • San Francisco, CA
View GitHub Profile
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)
}
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 = {
$(‘.myClass’)
$(‘form’).on(“submit”, function (e) {
e.preventDefault();
alert(“Your form has been submitted.”);
})
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
//= require card
//= require decks
@lizdenhup
lizdenhup / odd.rb
Last active November 10, 2016 23:10
Practice interview questions
# 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
@lizdenhup
lizdenhup / attraction.rb
Created October 29, 2016 16:38
rails-amusement-park-v-000
class Attraction < ActiveRecord::Base
has_many :rides
has_many :users, through: :rides
validates_presence_of :name, :min_height, :nausea_rating, :happiness_rating, :tickets
end
module AirBnbMod
module InstanceMethods
end
module ClassMethods
end
@lizdenhup
lizdenhup / application_controller.rb
Created October 3, 2016 21:27
Helper methods for use in a Sinatra CRUD app
require './config/environment'
class ApplicationController < Sinatra::Base
helpers do
def logged_in?
!!session[:id]
end
def current_user
@lizdenhup
lizdenhup / wikinews_scraper_spec.rb
Last active September 8, 2016 03:21
My first RSpec test suite <3
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