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
</html> | |
<head> | |
<link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css"> | |
<link href="https://fonts.googleapis.com/css?family=Kalam|Merienda:700" rel="stylesheet"> | |
<title>My portfolio</title> | |
</head> | |
<body> | |
<!-- Nav bar section --> | |
<nav class="navbar navbar-inverse navbar-fixed-top"> | |
<div class="container-fluid"> |
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
/* | |
Write a trigger that sets a case status to 'Closed' if there are more than 2 cases created | |
that day associated with the same contact | |
Also close cases if there are more than 3 cases created on that account that day | |
*/ | |
trigger MaxCases on Case (before insert) { | |
for(Case myCase : Trigger.new) { | |
//Find all cases created today | |
if(myCase.ContactId != null) { |
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
/* | |
Upon opportunity creation add the opportunity owner's manager as an opportunity team member with role 'Sales Manager' | |
If the opportunity owner is a manager, add one of their direct employees as a 'Sales Rep' opportunity team member | |
*/ | |
trigger OwnerManager on Opportunity (after insert) { | |
for(Opportunity opp : Trigger.new){ | |
//Get opp owner manager info |
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
/* | |
Write a trigger that sets the contact owner to whomever most recently created a case on the record | |
In the same trigger set the account owner to whomever most recently created a case on it | |
*/ | |
//After trigger to access Case createdById | |
trigger CaseContactOwner on Case (after insert) { | |
for(Case myCase : Trigger.new) { | |
//make sure there's a contact for null pointer exceptions |
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
/* | |
When an account's phone number is updated, all related contact's 'Other Phone' must be updated | |
Do not update the contact's phone if the contact's country differs from the account's country | |
*/ | |
trigger UpdateContactPhone on Account (before update) { | |
for(Account acc : Trigger.new){ | |
//Make sure the phone number is populated | |
if(acc.Phone != null){ |
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
/* | |
Move new contacts to the matching account based on domain. Contact email domain should match the website domain. | |
Ex. john@fastco.com matches only to an account with website www.fastco.com | |
*/ | |
trigger AccountMatcherHw on Contact (before insert) { | |
for (Contact con : Trigger.new) { | |
if(con.Email != null) { | |
//Create a website from the email domain |
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
/* | |
Move new contacts to the matching account based on domain. Contact email domain should match the website domain. | |
Ex. john@fastco.com matches only to an account with website www.fastco.com | |
Should also match with the following websites: http://www.fastco.com https://www.fastco.com | |
fastco.com fastco.com.au fastco.com.ca | |
*/ | |
trigger AccountMatcherChallenge on Contact (before insert, before update) { | |
for(Contact con : Trigger.New) { |
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
/* | |
When a new opportunity is created, all contacts on the corresponding account need to have | |
the following info added to their description: Opp creator's name , Opp close date | |
*/ | |
trigger AddOppInfoToContacts on Opportunity (after insert) { | |
for(Opportunity opp : Trigger.new) { | |
if(opp.AccountId != null) { |
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
#Format the link to navigate to the artists genius webpage | |
genius_urls <- paste0("https://genius.com/artists/",top_artists$Artist) | |
#Initialize a tibble to store the results | |
artist_lyrics <- tibble() | |
# Outer loop to get the song links for each artist | |
for (i in 1:10) { | |
genius_page <- read_html(genius_urls[i]) | |
song_links <- html_nodes(genius_page, ".mini_card_grid-song a") %>% |
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
#Identify the url from where you want to extract data | |
base_url <- "https://www.billboard.com/charts/greatest-of-all-time-pop-songs-artists" | |
webpage <- read_html(base_url) | |
# Get the artist name | |
artist <- html_nodes(webpage, ".chart-row__artist") | |
artist <- as.character(html_text(artist)) | |
# Get the artist rank | |
rank <- html_nodes(webpage, ".chart-row__rank") |
OlderNewer