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> | |
<head> | |
<title>Popular Repos</title> | |
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script> | |
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> | |
<script src='https://unpkg.com/babel-standalone@6/babel.min.js'></script> | |
<style> | |
body { | |
font-family: sans-serif; |
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> | |
<head> | |
<title>First React App</title> | |
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script> | |
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> | |
<script src='https://unpkg.com/babel-standalone@6/babel.min.js'></script> | |
<style> | |
body { | |
font-family: sans-serif; |
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
// Using vanilla JS (no jQuery) | |
// Your API key | |
var apiKey = "your-key-goes-here" | |
// Typically the URL will contain a key and other parameters (depending on the API you're making a call to) | |
var apiUrl = "the-API-URL-goes-here" + apiKey; | |
// Create the XMLHttpRequest object (allows us to make an AJAX call to an API) | |
// See more here: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest |
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 'csv' | |
module CarLoader | |
def self.get_cars_from_csv(filename) | |
# The result is being passed to the new dealership. | |
# I need to return some useful data from this method... | |
hashed_data = CSV.read(filename, {:headers => true, :header_converters => :symbol}) | |
mapped_data = hashed_data.map {|row| row.to_hash} |
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 ItemAdder | |
# This method appends a single item to the CSV file | |
def self.write(filename, item) | |
CSV.open(filename, "a+") do |csv| | |
csv << [item.description] | |
end | |
end | |
end |
NewerOlder