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
#!/bin/bash | |
cd ~/.ssh | |
echo "Please provide email for Github SSH. Use keyname /home/codespace/.ssh/github" | |
read email | |
ssh-keygen -t ed25519 -C $email | |
echo "Add/Update key got Github" | |
cat /home/codespace/.ssh/github.pub | |
eval "$(ssh-agent -s)" | |
ssh-add /home/codespace/.ssh/github | |
npm i -g sfdx-cli |
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
alias ll='ls -lahG' | |
alias home='cd ~' | |
alias ni="npm install" | |
alias nid="npm install --save-dev" | |
alias nis="npm install --save" | |
alias nit="npm init" | |
alias glog="git log --oneline --decorate --graph" | |
alias gsl="git diff --cached --name-only" | |
alias gad="git diff" |
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
class Animal { | |
constructor(name, age) { | |
this.name = name; | |
this.age = age; | |
} | |
eats() { | |
console.log(this.name + ' eats'); | |
} | |
} |
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
public with sharing class Utils { | |
//If parser is at start of inner object or array, skipping till end of the section | |
public static JSONParser skipTillEndOfSection(JSONParser parser) { | |
if(parser != null && parser.getCurrentToken() == JSONToken.START_ARRAY) { | |
if(parser.getCurrentToken() == JSONToken.START_ARRAY) { | |
while(parser.getCurrentToken() != JSONToken.END_ARRAY) { | |
parser.nextToken(); | |
if(parser.getCurrentToken() == JSONToken.START_ARRAY || parser.getCurrentToken() == JSONToken.START_OBJECT) { | |
skipTillEndOfSection(parser); |
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
public with sharing class PackageUtils { | |
private static Set<String> AccountFields = null; | |
//Method to check if person account is enabled | |
public static Boolean isPersonAccountEnabled() { | |
if (AccountFields == null) { | |
AccountFields = Schema.SObjectType.Account.fields.getMap().keyset(); | |
} | |
return AccountFields.contains('ispesonaccount'); | |
} |
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
List<AsyncApexJob> trackerJobs = [SELECT Id, Status, ApexClassID FROM AsyncApexJob WHERE Status IN ('Holding', 'Queued','Processing','Preparing') | |
AND ApexClassID IN (SELECT Id FROM ApexClass WHERE Name = 'TrackerSchedulable')]; | |
if(!trackerJobs.isEmpty()) { | |
//Apex jobs are running for specified class | |
} |
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
for(CronTrigger cTrigger : [SELECT Id, CronJobDetail.Name FROM CronTrigger WHERE CronJobDetail.Name like 'TrackerJob%']){ | |
//Try catch to ignore any exceptions to abort jobs | |
try{ | |
system.abortJob(cTrigger.Id); | |
} | |
catch (exception e) {} | |
} |
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
//This can be any time in future | |
Datetime nextRun = System.now().addHours(2); | |
//Generating cron expression for next run time | |
String year = String.valueOf(nextRun.year()); | |
String day = String.valueOf(nextRun.day()); | |
String hour = String.valueOf(nextRun.hour()); | |
String min = String.valueOf(nextRun.minute()); | |
String sec = String.valueOf(nextRun.second()); | |
String cronExp = sec + ' ' + min + ' ' + hour + ' '+day+' '+nextRun.format('MMM').toUpperCase()+' ? '+year; |
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
<aura:component controller="Util_AutocompleteInputController"> | |
<aura:attribute name="label" type="String"/> | |
<aura:attribute name="placeholder" type="String" default="Search"/> | |
<aura:attribute name="iconName" type="String" default="utility:account"/> | |
<aura:attribute name="objectToSearch" type="String" required="true"/> | |
<aura:attribute name="fieldToSearch" type="String" default="Name"/> | |
<aura:attribute name="fieldsToDisplay" type="String[]" default="['Name']"/> | |
<aura:attribute name="fieldsToReturn" type="String[]" default="['Id']"/> | |
<aura:attribute name="extraWhereClause" type="String" default=""/> |
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
<aura:application extends="force:slds"> | |
<div> | |
<c:DisplayBlogs></c:DisplayBlogs> | |
</div> | |
</aura:application> |
NewerOlder