Skip to content

Instantly share code, notes, and snippets.

View cdaz5's full-sized avatar

Chris D'Ascoli cdaz5

View GitHub Profile
const clientID = '82cf58344ff048c9b6df55e2b480e977';
let accessToken; // we use let because we plan to reassign it later
const redirectUri = 'http://localhost:3000/';
const Spotify = {
get getAccessToken() {
if (accessToken) {
return accessToken; // we return the token if it exists your naming was off is all
}
let accessToken = '';
const clientId = '664b972b62e44bec946cdda0e4d72ff9';
const redirectUri = 'http://localhost:3000/';
const Spotify = {
getAccessToken() {
if (accessToken) {
return accessToken;
console.log(`This is ${accessToken}`);
}
savePlayList(playListName, trackURIs) {
if (!playListName || !trackURIs.length) {
return;
}
const newAccessToken = this.getAccessToken();
let userId;
let playListId;
const header = {
Authorization: `Bearer ${newAccessToken}`
};
savePlayList: (name, trackURIs) => {
if (!name || !trackURIs.length) {
return;
}
//Step 91: Create 3 variables, one for access token set to users token
//a header set to object with authorization parameter with user's token from Spotify's implicit grnat flow
//an empty variable for user ID.
const accessToken = Spotify.getAccessToken();
const headers = {
Authorization: `Bearer ${accessToken}`
<!DOCTYPE html>
<html>
<head>
<title>
Daddy & Ronan's Secret Message Decoder
</title>
</head>
<body>
<input type="text" id="user">
<button id="expand">Enter</button>
import React, { Component } from 'react';
import logo from './logo.svg';
import './track.css';
class Track extends Component {
constructor(props) {
super(props)
this.addTrack = this.addTrack.bind(this);
if (jsonResponse.businesses) {
return jsonResponse.businesses.map(business => {
id: business.id,
imageSrc: business.image_url,
name: business.name,
address: business.location.address1,
city: business.location.city,
state: business.location.state,
zipCode: business.location.zip_code,
category: category.title,
const App = () => (
<Container>
<PulseLoader
loading
width={200}
height={200}
pColor="green"
sColor="yellow"
/>
<BouceLoader
@cdaz5
cdaz5 / index.js
Created May 2, 2018 21:38
index.js
import React from "react";
import { render } from "react-dom";
import styled from "styled-components";
// we import our new loaders
import PulseLoader from "./PulseLoader";
import BouceLoader from "./BouceLoader";
// we create a div to hold our components to give them some breathing room
// otherwise they would render on top of each other
@cdaz5
cdaz5 / BounceLoader.js
Created May 2, 2018 21:19
BounceLoader.js
import React from "react";
import styled, { keyframes } from "styled-components";
// we create our bounce effect with the below keyframe
const bounce = keyframes`
0%, 75%, 100% {
transform: translateY(0px)
}
25% {
transform: translateY(-30px)