Skip to content

Instantly share code, notes, and snippets.

View saicharanreddyk's full-sized avatar

Saicharan Reddy K saicharanreddyk

View GitHub Profile
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>
@saicharanreddyk
saicharanreddyk / How to pass sobject as a paratemer to the apex class?
Created February 6, 2020 12:50
Lightning - How to pass sobject as a paratemer to the apex class?
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});