Skip to content

Instantly share code, notes, and snippets.

Jesse Altman jessealtman

Block or report user

Report or block jessealtman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jessealtman / MyController
Created Jun 27, 2014
Real Unit Tests using ApexMocks
View MyController
public class MyController{
private MyInterface myImplementation;
public Integer valueOne{get;set;}
public Integer valueTwo{get;set;}
public MyController(MyInterface myImplementation){
this.myImplementation = myImplementation;
public Integer calculatedTotalValue(){
# Specify the login credentials for the desired Salesforce organization
sf.username = <insert username here>
sf.password = <insert password and security token>
# Use '' for production or developer edition
# Use ' for sandbox.
sf.serverurl =
sf.maxPoll = 20
jessealtman / ExampleController
Created Apr 19, 2014
Proper Unit Test Structure in Apex
View ExampleController
public class ExampleController
public Integer differenceInFooWidgetsAndStubCount(Id fooId, Id stubId){
Foo__c foo = [
(SELECT Id FROM Widget__r)
jessealtman / StackExchangeService
Created Apr 19, 2014
StackExchange API on Salesforce!
View StackExchangeService
public class StackExchangeService{
public List<SFSEQuestion> getStackExchangeQuestionsDeserialize(){
Http httpQuestions = new Http();
HttpRequest requestQuestions = new HttpRequest();
requestQuestions.setHeader('Content-Type', 'application/json');
HTTPResponse responseQuestions = httpQuestions.send(requestQuestions);
List<SFSEQuestion> questions = new List<SFSEQuestion>();
jessealtman / PaymentInterface
Created Apr 19, 2014
Dependency Injection in Apex
View PaymentInterface
public interface PaymentInterface{
String processPayment();
View ChatterGalleryPage
<apex:page showHeader="true" sidebar="true" title="Chatter Gallery" controller="ChatterGalleryPageController">
<apex:includeScript value="//"/>
<apex:includeScript value="//"/>
<apex:stylesheet value="//"/>
<apex:includeScript value="{!URLFOR($Resource.Galleria,'galleria/galleria-1.3.5.min.js')}"/>
.galleria{ width: 700px; height: 400px; background: #000 }
<apex:sectionHeader title="View Chatter Images" subtitle="Chatter Gallery" />
You can’t perform that action at this time.