Skip to content

Instantly share code, notes, and snippets.

View dcinzona's full-sized avatar
๐Ÿ†”
๐Ÿง‘โ€๐Ÿ’ป๐ŸŒŽ๐ŸŒŽ๐ŸŒŽโ˜๏ธ

Gustavo Tandeciarz dcinzona

๐Ÿ†”
๐Ÿง‘โ€๐Ÿ’ป๐ŸŒŽ๐ŸŒŽ๐ŸŒŽโ˜๏ธ
  • Salesforce
  • Washington, DC
View GitHub Profile
@dcinzona
dcinzona / readlog.py
Last active February 3, 2022 22:43
Saleforce Log File SOQL Query parser
"""
Run via command line: python3 readlog.py [logfile] [optional:outputfilecsv]
Requires Python 3.6 or higher
"""
import os,sys,re,traceback
#import Operations.Operation as Operation
"""
15:05:12.412 (20450194753)|CODE_UNIT_STARTED|[EXTERNAL]|Flow:01Ir0000000HCxR
15:05:12.412 (20747809148)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:01Ir0000000HCxE
15:05:12.893 (21137018664)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:PersonAccount:001r000000l8CIV
@dcinzona
dcinzona / MakePowerShellRememberSSHPassphrase.md
Created December 11, 2021 16:44 — forked from yevhen/MakePowerShellRememberSSHPassphrase.md
How to make Powershell remember the SSH key passphrase.

You should not use the Open SSH client that comes with Git for Windows. Instead, Windows 10 has its own implementation of Open SSH that is integrated with the system. To achieve this:

  1. Start the ssh-agent from Windows Services:
  • Type Services in the Start Menu or Win+R and then type services.msc to launch the Services window;
  • Find the OpenSSH Authentication Agent in the list and double click on it;
  • In the OpenSSH Authentication Agent Properties window that appears, choose Automatic from the Startup type: dropdown and click Start from Service status:. Make sure it now says Service status: Running.
  1. Configure Git to use the Windows 10 implementation of OpenSSH by issuing the following command in Powershell:
git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
- plugin: snowfakery.standard_plugins.Salesforce.SOQLDataset
- plugin: snowfakery.standard_plugins.Salesforce.SalesforceQuery
- include_file: account.macro.yml
- object: Account
include: account
fields:
__user:
SOQLDataset.shuffle:
#SalesforceQuery.random_record:
fields: Id
@dcinzona
dcinzona / findFields.sh
Last active September 17, 2021 18:50
Search XML for Salesforce Fields (Flows)
#!/bin/sh
# Purpose: Parse Salesforce XML / Flows to find fields referenced in an input CSV
# Fields CSV Format:
# sobject,fieldApi,ObjectLabel,FieldLabel,PerformFunctionalAssessment
# Author: Gustavo Tandeciarz
# Requires: xmlstarlet (brew install xmlstarlet)
# execution to parse flows: ./findFields.sh fields.csv ./src/flows
# ------------------------------------------
@dcinzona
dcinzona / SOQL Queries.sql
Created June 7, 2021 13:45 — forked from sholloway/SOQL Queries.sql
Useful SOQL queries for exploring a Salesforce org.
--------------------------------------------------------------------
-- Queries related to distribution of metadata.
-- Find the number of users per profile.
SELECT count(id), Profile.name
FROM User
WHERE User.IsActive = true
GROUP BY Profile.name
-- Find the distribution of Apex classes per namespace.
select count(id), NameSpacePrefix
@dcinzona
dcinzona / Convert-WSDL-to-CSharp.md
Last active October 24, 2024 12:06
Convert WSDL to CSharp

Converting a WSDL to C# using dotnet core

Install dotnet core

  1. Go to https://dotnet.microsoft.com/download and install
  2. If using ZSH (z-shell), add these to your config (.zshrc)
    1. Add to your PATH export :$HOME/dotnet
    2. Add to the bottom export DOTNET_ROOT=$HOME/dotnet
    3. Optional Add an alias for svcutil at the bottom alias dotnet-svcutil="dotnet svcutil $1"
  3. Verify dotnet is installed and working from the command line
  4. Open terminal and run dotnet --version
  1. Copy the VM Image from the USB stick to your mac (say, your desktop)
  2. Download and Install VirtualBox (https://download.virtualbox.org/virtualbox/6.1.12/VirtualBox-6.1.12-139181-OSX.dmg)
  3. Download and Install Parallels Desktop (https://www.parallels.com/products/desktop/trial/) (you will probably have to reboot)
  4. Open Terminal (command + space and type "terminal" and press enter)
  5. VirtualBox may have installed under /Applications. If so, use the following commands:
  • cd /Applications/VirtualBox.app/Contents/MacOS
  • VBoxManage clonemedium disk ~/Desktop/[IMAGE FILE NAME].vhdx ~/Desktop/converted.vdi --format vdi (replace [Image File Name] with the name of the image you copied from the USB stick)
  1. Wait... This takes a while and clones the image to a new format. Once this is done, close the terminal window.
  2. Open Parallels Desktop
  3. Click on the Open button on the bottom left of the window that appears
@dcinzona
dcinzona / PromoBlockingMethods.md
Last active July 1, 2020 14:08
Some methods for hiding ads or promoted content on sites

Twitter.com timeline promoted tweets

Add css via your favorite extension div[data-testid="placementTracking"] article { display : none!important }

Feedly sponsored ads

Update /etc/hosts (hosts file) and add 127.0.0.1 srv.buysellads.com (or block the domain some other way)

@dcinzona
dcinzona / git-branch-to-favicon.js
Created March 26, 2020 15:51 — forked from tigt/git-branch-to-favicon.js
Creates an SVG string that can be used as a favicon across different Git branches. Actually getting this into the browser is sadly project-specific.
const { execSync } = require('child_process')
const { createHash } = require('crypto')
const invertColor = require('invert-color')
const branchName = execSync('git rev-parse --abbrev-ref HEAD')
const hash = createHash('sha256')
hash.update(branchName)
const color = '#' + hash.digest().toString('hex').substring(0, 6)
const invertedColor = invertColor(color, true)
@dcinzona
dcinzona / AWS_Helper.cls
Created May 1, 2018 18:38
Salesforce Apex AWS S3 Signature Helper class
/**
* Created by gtandeciarz on 12/14/16.
*/
public class AWS_Helper {
public string secret { get; set; }
public string key { get; set; }
public string bucket {get;set;}
public String endpoint_x = 'https://s3.amazonaws.com/';
public Integer version = 2;