Skip to content

Instantly share code, notes, and snippets.

View sudhakar6's full-sized avatar
🎯
Focusing

Sudhakar sudhakar6

🎯
Focusing
View GitHub Profile
@sudhakar6
sudhakar6 / NonRegularGitCommands
Last active December 28, 2022 06:46
The GIT commands not used frequently and forgettable
https://levelup.gitconnected.com/15-git-commands-you-should-learn-before-your-very-first-project-f8eebb8dc6e9
https://www.freecodecamp.org/news/learn-the-basics-of-git-in-under-10-minutes-da548267cc91/
https://www.freecodecamp.org/news/7-git-commands-you-might-not-know/
Setup user:
git config --global user.email "yourGitHub@email.com"
git config --global user.name "yourGitHubusername"
git config -l (If you wish to check your configuration settings.)
@sudhakar6
sudhakar6 / package.xml
Last active October 28, 2020 06:06
package.xml with all metadata types
ActionLinkGroupTemplate,ApexClass,ApexComponent,ApexPage,ApexTrigger,AppMenu,ApprovalProcess,AssignmentRules,
AuraDefinitionBundle,AuthProvider,AutoResponseRules,BrandingSet,CallCenter,Certificate,CleanDataService,Community,
ConnectedApp,ContentAsset,CorsWhitelistOrigin,CustomApplication,CustomApplicationComponent,CustomFeedFilter,
CustomHelpMenuSection,CustomLabels,CustomMetadata,CustomObject,CustomObjectTranslation,CustomPageWebLink,CustomPermission,
CustomSite,CustomTab,Dashboard,DataCategoryGroup,DelegateGroup,Document,DuplicateRule,EclairGeoData,EmailServicesFunction,
EmailTemplate,EscalationRules,ExternalDataSource,ExternalServiceRegistration,FlexiPage,Flow,FlowCategory,FlowDefinition,
GlobalValueSet,GlobalValueSetTranslation,HomePageComponent,HomePageLayout,InstalledPackage,Layout,Letterhead,LightningBolt,
LightningComponentBundle,LightningExperienceTheme,MatchingRules,NamedCredential,NetworkBranding,PathAssistant,PermissionSet,
PlatformCachePartition,PostTemplate,Profile,ProfileSessionSetting,Queue,Qu
@sudhakar6
sudhakar6 / Sfdc Session ID code
Last active March 16, 2023 13:35
Code to get session and login with session ID
code to get session id:
System.debug('&######## '+ UserInfo.getOrganizationId()+''+UserInfo.getSessionId().SubString(15));
Login URL: <orgURL>/secur/frontdoor.jsp?sid=<orgSessionID>
for f in "$@"
do
DEST=""
if [[ $f == *"Screenshot"* ]]
then
DEST=/Users/s.chintapalli/Dropbox/Screenshots
elif [[ $f == *"Screen Recording"* ]]
then
DEST="/Users/s.chintapalli/Desktop/Screen Recordings"
fi
command to retrieve componenets from a package:
sfdx force:source:retrieve -n "packageName"
To define metadata of your org:
sfdx force:mdapi:describemetadata -f pathwhereyouwanttosavefile\filename.json
@sudhakar6
sudhakar6 / FilesToExcludeScriptForVSCode.Txt
Last active January 14, 2022 14:47
Script to exclude files containing, starting or ending with a specific text in the name for VSCode Global Search
Paste the below script in 'files to exclude' box in VSCode global search to avaoid the files containing, starting or ending with the text 'TEST' and it is case sensitive.
*TEST.cls,*Test.cls,Test*,*Test*
Fallow the same approach for 'files to exclude'
@sudhakar6
sudhakar6 / SOQL Queries
Last active February 12, 2022 13:43
SOQL Queries
Query duplicate record based on a field:
Field: Account.Email__c
SELECT Email__c, COUNT(Id) FROM Account GROUP BY Email__c HAVING COUNT(Id) > 1 ORDER BY Count(ID) DESC
@sudhakar6
sudhakar6 / namechange.bat
Created May 4, 2022 19:09
Windows batch script to find a string in files names and replace with another string. Ex: file.md-meta.xml to file1.md-meta.xml. It loops through the all files and changes file name
@echo off
setlocal enableDelayedExpansion
for %%F in (*.md-meta.xml) do (
set "name=%%F"
ren "!name!" "!name:.md-meta=1.md-meta!"
)
@sudhakar6
sudhakar6 / filenamechange.py
Last active May 9, 2022 07:25
Python script to change the change files names in a directory(Windows, May work for Mac as well but not tested)
import os
path = r'C:\Users\SudhakaraReddy.Chint\Desktop\customMetadata\\'
files = os.listdir(path)
for index, file in enumerate(files):
print(file)
#To remove suffix of the file name, this can be replaced based on the requirement
filern = file.removesuffix('.md-meta.xml')
#To remove last three characters of the file name, this can also be modified.
You can use cmmand+ to increase size and font of terminal
https://www.youtube.com/watch?v=iFvXNfFE_IE
To clear : Command+K or clear (When you click command K it completely erases but when you use "clear" it just scriolls up), command+l (it just clears the previous command we used)
To check software version type: sw_vers
To know even more details: system_profiler (it gives you lots of information, that you can't even read
To go to the granualar level of system usage caommand: system_profiler -usage (it gives different commands and it's uage)
To use a specific types which is given by above command: system_profiler -listDataTypes (which gives all the data types)
To find is there any software to update: softwareupdate -l
To monitor network connections: nettop (press q to come out of that window)
To monitor the tcp netowrk connections: nettop -m tcp (it shows all the connections using tcp)