Skip to content

Instantly share code, notes, and snippets.

View sudhakar6's full-sized avatar
🎯
Focusing

Sudhakar sudhakar6

🎯
Focusing
View GitHub Profile
@msrivastav13
msrivastav13 / tasks.json
Created October 12, 2020 21:02
This one is for Retrieving org metadata using packages
{
"version": "2.0.0",
"tasks": [
{
"label": "SFDX: Retrieve Metadata From Package",
"type": "shell",
"command": "sfdx",
"args": [
"force:source:retrieve",
"-n",
@johndstein
johndstein / SamlJitHandler.java
Created January 31, 2018 20:17
Salesforce SAML JIT Handler
// This class provides logic for inbound just-in-time provisioning of single
// sign-on users in your Salesforce organization.
// Here's all the info we're going to have.
//
// Employee Id
// First Name
// Last Name
// Email
// Active Flag
# GET VERSION
yarn -v (or --version)
# GET HELP
yarn help
# CREATE PACKAGE.JSON
yarn init
yarn init -y // Use defaults
@Jonalogy
Jonalogy / handling_multiple_github_accounts.md
Last active April 19, 2025 04:49
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@mannharleen
mannharleen / AnimalLocator.cls
Created October 31, 2016 15:36
Salesforce trailhead - Apex-Integration-Services-Apex-REST-Callouts
public class AnimalLocator {
public class cls_animal {
public Integer id;
public String name;
public String eats;
public String says;
}
public class JSONOutput{
public cls_animal animal;
@mannharleen
mannharleen / AccountProcessor.cls
Created October 31, 2016 15:32
Salesforce trailhead - Asynchronous Apex Using Future Methods
public class AccountProcessor {
@future
public static void countContacts(List<Id> accountId_lst) {
Map<Id,Integer> account_cno = new Map<Id,Integer>();
List<account> account_lst_all = new List<account>([select id, (select id from contacts) from account]);
for(account a:account_lst_all) {
account_cno.put(a.id,a.contacts.size()); //populate the map
@mannharleen
mannharleen / AccountManager.cls
Last active November 24, 2022 10:00
Salesforce trailhead - Apex-Integration-Services-Apex-Web-Services
@RestResource(urlMapping='/Accounts/*/contacts')
global with sharing class AccountManager {
@HttpGet
global static account getAccount() {
RestRequest request = RestContext.request;
String accountId = request.requestURI.substring(request.requestURI.lastIndexOf('/')-18,
@jamesramsay
jamesramsay / README.md
Last active March 29, 2025 18:58
Gmail: delete old emails automatically

Gmail: delete old emails automatically

Automatically deletes old emails that match the specified label.

Get started

  • Create a new Google Apps Script at https://script.google.com
  • Overwrite the placeholder with the javascript below
  • Update the following constants:
  • LABEL_TO_DELETE: the label that should be have old messages deleted
@gene1wood
gene1wood / batch-delete-gmail-emails.js
Last active April 14, 2025 13:45
A Google Apps Script script to bulk delete large amounts of email in Gmail while avoiding the error #793 which Gmail encounters normally
/*
This script, when used with Google Apps Scripts, will delete 400 emails and
can be triggered to run every few minutes without user interaction enabling you
to bulk delete email in Gmail without getting the #793 error from Gmail.
Google returns a maximum of 500 email threads in a single API call.
This script fetches 400 threads in case 500 threads is causing timeouts
Configure the search query in the code below to match the type of emails
you want to delete