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
printf "Setting the session-based environment variables\n" | |
export devhubname= Enter you Devhub org username | |
export consumerkey= Enter consumer Key | |
export jwtkeylocation="Location of the server.key" | |
export location="Where do you want your projects needs to be" | |
printf "Changing the location into project folder\n" | |
cd "$location" | |
printf "Creating new directory $(date +'%Y%m%d%H%M')\n" | |
mkdir $(date +'%Y%m%d%H%M') | |
cd $(date +'%Y%m%d%H%M') |
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
function YouTubeScraper() { | |
var sh1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1"); | |
var keyword = sh1.getRange("B1").getValue(); | |
var results = YouTube.Search.list('id,snippet', {q:keyword, maxResults:50}); | |
//Video ID Published Date Channel ID "Video Title | |
//" Description Thumbnail URL Channel Title | |
var items = results.items.map(function(e){ | |
return [e.id.videoId, | |
e.snippet.publishedAt, |
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
(async function importSEs() { | |
/* Auxiliary function to open a file selection dialog */ | |
function selectFileToRead() { | |
return new Promise((resolve) => { | |
const input = document.createElement('input'); | |
input.setAttribute('type', 'file'); | |
input.addEventListener('change', (e) => { | |
resolve(e.target.files[0]); | |
}, false); | |
input.click(); |
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
(function exportSEs() { | |
/* Auxiliary function to download a file with the exported data */ | |
function downloadData(filename, data) { | |
const file = new File([data], { type: 'text/json' }); | |
const elem = document.createElement('a'); | |
elem.href = URL.createObjectURL(file); | |
elem.download = filename; | |
elem.click(); | |
} |
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
"workbench.colorCustomizations": { | |
"terminal.background": "#FFFFFF", | |
"terminal.foreground": "#4D4D4C", | |
"terminalCursor.background": "#4D4D4C", | |
"terminalCursor.foreground": "#4D4D4C", | |
"terminal.ansiBlack": "#FFFFFF", | |
"terminal.ansiBlue": "#4271AE", | |
"terminal.ansiBrightBlack": "#8E908C", | |
"terminal.ansiBrightBlue": "#4271AE", | |
"terminal.ansiBrightCyan": "#3E999F", |
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
@IsTest | |
private class AccountServiceTest { | |
@IsTest | |
static void should_create_account() { | |
String acctName = 'Salesforce'; | |
String acctNumber = 'SFDC'; | |
String tickerSymbol = 'CRM'; | |
Test.startTest(); | |
AccountService service = new AccountService(); | |
Account newAcct = service.createAccount( acctName, acctNumber, tickerSymbol ); |
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
public with sharing class AccountService { | |
public Account createAccount( String accountName, String accountNumber, String tickerSymbol ) { | |
Account newAcct = new Account( | |
Name = accountName, | |
AccountNumber = accountNumber, | |
TickerSymbol = accountNumber | |
); | |
return newAcct; | |
} | |
} |
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
<aura:component> | |
<aura:attribute name="globalId" type="String"/> | |
<aura:registerEvent name="appEvent" type="c:LightningSimpleEvent"></aura:registerEvent> | |
<aura:handler event="c:LightningSimpleEvent" action="{!c.handleEvent}" phase="capture"></aura:handler> | |
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/> | |
<lightning:layout multipleRows="true"> | |
<lightning:layoutItem size="12" padding="around-small"> | |
Component: {!v.globalId} | |
</lightning:layoutItem> | |
<lightning:layoutItem size="12" padding="around-small"> |
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
<aura:application extends="force:slds"> | |
<aura:attribute name="globalId" type="String" /> | |
<aura:registerEvent name="compEvent" type="c:LightningComponentEvent"></aura:registerEvent> | |
<aura:handler name="compEvent" event="c:LightningComponentEvent" action="{!c.handleEvent}" phase="bubble"></aura:handler> | |
<aura:handler name="compEvent" event="c:LightningComponentEvent" action="{!c.handleEventCapture}" phase="capture"></aura:handler> | |
<aura:handler name="init" value="{!this}" action="{!c.doInit}" /> | |
<lightning:layout multipleRows="true"> | |
<lightning:layoutItem size="12" padding="around-small"> | |
Application: {!v.globalId} | |
</lightning:layoutItem> |
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
How to pass sobject as a paratemer to the apex class? | |
In this below example we are trying to insert the records in apex example by taking the sObject as parameter to Apex class. | |
While initializing the attribute as below we have to initilize the Account by default="{sObjectType:'Account'} | |
<aura:attribute name="acc" type="Account" default="{sObjectType:'Account'}" /> | |
>> We are reading the input values from component and from the component | |
>> In helper we are getting the details ( Account acc details) and then we are passing the values as param | |
action.setParams({"acc":account}); |