Skip to content

Instantly share code, notes, and snippets.

View saicharanreddyk's full-sized avatar

Saicharan Reddy K saicharanreddyk

View GitHub Profile
@saicharanreddyk
saicharanreddyk / AutomationOutput.txt
Last active April 10, 2020 10:23
Automation Output
Setting the session-based environment variables
Changing the location into project folder
Creating new directory 202004101432
Cloning dreamhouse github repo
Cloning into 'dreamhouse-sfdx'...
remote: Enumerating objects: 1714, done.
remote: Total 1714 (delta 0), reused 0 (delta 0), pack-reused 1714
Receiving objects: 100% (1714/1714), 4.98 MiB | 913.00 KiB/s, done.
Resolving deltas: 100% (944/944), done.
Updating files: 100% (427/427), done.
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')
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,
@saicharanreddyk
saicharanreddyk / To import settings from a JSON file created using the script above
Created March 28, 2020 04:09
To import settings from a JSON file created using the script above
(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();
@saicharanreddyk
saicharanreddyk / To download a JSON file with search engine settings
Created March 28, 2020 04:07
To download a JSON file with search engine settings
(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();
}
"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",
@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 );
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;
}
}
<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">
@saicharanreddyk
saicharanreddyk / CompEventLifecycleApp.app
Created February 12, 2020 11:40 — forked from maujood/CompEventLifecycleApp.app
Lighting Component Events Demo
<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>