This file contains 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
$(".title").removeClass("light-blue") |
This file contains 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
var exclaim = (string) => {return string + "!"} | |
var words = ["let's", "do", "this"] | |
console.log(words.map(exclaim)) | |
//[ 'let\'s!', 'do!', 'this!' ] |
This file contains 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
var exclaim = (string) => {return string + "!"} | |
var words = ["let's", "do", "this"] | |
console.log(words.map(exclaim)) |
This file contains 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
<%= render file: 'view_directory/file_name'%> |
This file contains 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
tracks = RestClient.get(query_url, {"Authorization": "Bearer #{parsed_token["access_token"]}"}) | |
parsed_tracks = JSON.parse(tracks) |
This file contains 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
client_token = Base64.strict_encode64("#{ENV['spotify_id']}:#{ENV['spotify_secret']}") | |
spotify_token = RestClient.post("https://accounts.spotify.com/api/token",{"grant_type": "client_credentials"}, {"Authorization": "Basic #{client_token}"}) | |
parsed_token = JSON.parse(spotify_token) |
This file contains 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
@artist_data = JSON.parse(response)["artists"]["items"][0] | |
top_tracks_url = "https://api.spotify.com/v1/artists/#{@artist_data["id"]}/top-tracks?country=US" | |
top_tracks_results = JSON.parse(RestClient.get(top_tracks_url)) |
This file contains 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
searchURL = "https://api.spotify.com/v1/search?q=#{artist_name}&type=artist" | |
response = RestClient.get(searchURL) |
This file contains 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
def emoji_finder(file_path) | |
Dir.foreach(file_path) {|pic| | |
if pic[-3..-1] == 'png' | |
puts pic | |
end | |
} | |
end | |
emoji_finder('/Users/rachel/dev/EmojiFinder/ProfileImages') |
This file contains 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
def image_list(file_path) | |
puts Dir.entries(file_path) | |
end |