Skip to content

Instantly share code, notes, and snippets.

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

Gustavo Tandeciarz dcinzona

๐Ÿ†”
๐Ÿง‘โ€๐Ÿ’ป๐ŸŒŽ๐ŸŒŽ๐ŸŒŽโ˜๏ธ
  • Salesforce
  • Washington, DC
View GitHub Profile
(function () {
var root = $(document.getElementsByTagName('body'));
var watchers = [];
var f = function (element) {
if (element.data().hasOwnProperty('$scope')) {
angular.forEach(element.data().$scope.$$watchers, function (watcher) {
watchers.push(watcher);
});
}
@dcinzona
dcinzona / OpenWithVisualStudioCode.bat
Created June 6, 2016 16:17 — forked from nhtera/OpenWithVisualStudioCode.bat
Open folders and files with Visual Studio Code from windows explorer context menu (tested in Windows 10)
@echo off
SET codePath=C:\Program Files (x86)\Microsoft VS Code\code.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Visual Studio Code" /t REG_SZ /v "" /d "Open with Visual Studio Code" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Visual Studio Code" /t REG_EXPAND_SZ /v "Icon" /d "%codePath%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Visual Studio Code\command" /t REG_SZ /v "" /d "%codePath% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Visual Studio Code" /t REG_SZ /v "" /d "Open with Visual Studio Code" /f
@dcinzona
dcinzona / .bash_profile
Created June 17, 2016 13:25
Bash Profile
# Set architecture flags
export ARCHFLAGS="-arch x86_64"
# Ensure user-installed binaries take precedence
export PATH=/usr/local/bin:$PATH
# Load .bashrc if it exists
test -f ~/.bashrc && source ~/.bashrc
txtblk='\e[0;30m' # Black - Regular
txtred='\e[0;31m' # Red
txtgrn='\e[0;32m' # Green
@dcinzona
dcinzona / CustomPermissionsReader.cls
Created March 23, 2017 18:28
Salesforce Custom Permissions Reader
/**
* Copyright (c), Andrew Fawcett
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
@dcinzona
dcinzona / forgetDeleted.sh
Last active March 27, 2017 11:14
Git command to not track deleted files
#!/bin/bash
for i in `git status | grep deleted | awk '{print $2}'`; do git update-index --assume-unchanged $i; done
@dcinzona
dcinzona / resizeVFQuickAction.html
Created May 4, 2017 17:50
Code snippet to resize a VF quick action based on the height of the content
<apex:includeScript value="/canvas/sdk/js/publisher.js"/>
<script type="text/javascript">
Sfdc.Dom.onReady(function () {
Sfdc.canvas.publisher.subscribe(
{
name : "publisher.showPanel",
onData:function(e) {
resizeCanvas();
}
}
@dcinzona
dcinzona / Readme.md
Last active May 5, 2017 12:51
Self-resizing iframes for Salesforce

##Quick instructions:

  1. Make a canvas app that loads the VF page VisualForceIFrameWrapper.page and pre-approve it for all profiles
  2. Add that canvas app to your page layout
  3. Profit
@dcinzona
dcinzona / VisualForcePageUsage.page
Last active June 26, 2017 13:52
Get VisualsForce usage count
<!--
- Created by gtandeciarz on 6/21/17.
-->
<apex:page id="VisualForcePageUsage" title="VisualForce Page Metrics" readOnly="true" setup="true" standardStylesheets="false">
<apex:slds ></apex:slds>
<script type="text/javascript">
var __sfdcSessionId = '{!GETSESSIONID()}';
</script>
<script src="../../soap/ajax/40.0/connection.js"

IDE

IntelliJ IDEA

@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