Skip to content

Instantly share code, notes, and snippets.

$(".title").removeClass("light-blue")
var exclaim = (string) => {return string + "!"}
var words = ["let's", "do", "this"]
console.log(words.map(exclaim))
//[ 'let\'s!', 'do!', 'this!' ]
var exclaim = (string) => {return string + "!"}
var words = ["let's", "do", "this"]
console.log(words.map(exclaim))
<%= render file: 'view_directory/file_name'%>
tracks = RestClient.get(query_url, {"Authorization": "Bearer #{parsed_token["access_token"]}"})
parsed_tracks = JSON.parse(tracks)
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)
@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))
searchURL = "https://api.spotify.com/v1/search?q=#{artist_name}&type=artist"
response = RestClient.get(searchURL)
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')
def image_list(file_path)
puts Dir.entries(file_path)
end