Skip to content

Instantly share code, notes, and snippets.

View dcinzona's full-sized avatar
🏠
Working from home

Gustavo Tandeciarz dcinzona

🏠
Working from home
View GitHub Profile
@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 March 4, 2024 19:27
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;
@dcinzona
dcinzona / ActiveX_POC.html
Created October 25, 2017 14:40
ActiveX file download POC
<apex:page >
<script type="text/javascript">
var sflogo = '/img/seasonLogos/Winter_18_yeti_175x65.png';
fso = new ActiveXObject("Scripting.FileSystemObject");
var currentDirectory="c:\\windows\\temp\\";//fso.GetAbsolutePathName(".");
document.write(currentDirectory + "<br>");
var fp = currentDirectory+"logo198.png";
document.write(fp);
function BinaryFile(filepath){
var adTypeBinary=1,adTypeText=2;

23andme

{
	"name": "23AndMe",
    "desc": "23andMe is a personal genetics service. 23andMe offers individual genome and DNA testing and information. The 23andMe API allows developers to access and integrate the data from 23andMe with other applications and to create new applications. Individuals consent to giving third-party access to the 23andMe data. Some example API methods include accessing user information, retrieving profiles, and getting information on genotypes",
	"url": "https://api.23andme.com",
	"oauth2": {
		"authorize": "/authorize",
@dcinzona
dcinzona / Jira_Issue_Aggregator.cls
Last active August 15, 2017 19:36
JIRA Issue Aggregator by Week
public class Jira_Issue_Aggregator {
public static void aggregate(){
List<Jira_Issue_Week_Aggregation__c> aggrs = [SELECT Id FROM Jira_Issue_Week_Aggregation__c];
if(aggrs.size() > 0){
delete aggrs;
}
Map<string, Jira_Issue_Week_Aggregation__c> aggrMap = new Map<string, Jira_Issue_Week_Aggregation__c>();
Set<Date> dates = new Set<Date>();
@dcinzona
dcinzona / Readme.md
Created July 10, 2017 16:16
Email-to-case with Dynamic email aliasing

Setting up a test environment (using GMAIL as the forwarder)

The gist here is that you will be using a dynamic email alias to forward emails to salesforce by using a combination of filters and forwarders in gmail. Dynamic email aliasing is the concept of adding a "+alias" string after your email username, so myuser@gmail.com would become myuser+sandboxalias@gmail.com

This works well with Acumen Solutions as Acumen uses GMAIL as the email service provider. You can set up your own email-to-case forwarding alias to your SFDC sandboxes without requiring any external administrator support.

  1. Salesforce: Create an email-to-case routing address and point it to yourusername+sandboxalias@acumensolutions.com (so for me, this would be gtandeciarz+gmtdev@acumensolutions.com
  2. Gmail: Verify the service from your acumen email (you should have a new email from Salesforce Sandbox with a link to verify the email address)
  3. Gmail: Create a forwarding email address in Gmail by going to Settings > Forwarding and P