Skip to content

Instantly share code, notes, and snippets.

@mickle00
mickle00 / gist:4137588
Created November 23, 2012 22:32
Hacky workaround to force newLine
<apex:page readOnly="true"
contentType="application/octet-stream#MyCsv.csv"
sidebar="false"
standardStylesheets="false"
showHeader="false"
cache="true"
expires="0">
<!--
Contact c = new Contact();
c.LastName = NULL;
system.debug(JSON.serializePretty(c));
/**
OUTPUT:
13:32:20.047 (47447000)|USER_DEBUG|[12]|DEBUG|{
"attributes" : {
public with sharing class BusinessHoursClass_Test{
static testMethod void holidayShouldNotIncludeBusinessHours(){
BusinessHours supportHours = BusinessHoursClass.getBusinessHoursMap().get('GSO Salesforce Support');
Time midnight = Time.newInstance(0,0,0,0);
Date startDate = Date.newInstance(2013,12,24);
DateTime pacificStartDateTime = DateTime.newInstance(startDate,midnight);
Date pacificStartDate = date.valueOf(pacificStartDateTime);
@mickle00
mickle00 / CPU_Test.java
Created September 9, 2013 19:05
Reproducible code that shows CPU Limits not getting reset as part of Test.startTest()
@isTest(seeAlLData=False)
private class CPU_Test{
/**
There are two additional system static methods provided by Apex.
These methods, Test.startTest and Test.stopTest, are used when testing governor limits.
Or in other words, executing test scenarios with a larger data set.
The Test.startTest method marks the point in your test code when your test actually begins.
Each test method is allowed to call this method only once.
All of the code before this method should be used to initialize variables, populate data structures,

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Projects</members>
<name>CustomApplication</name>
</types>
<types>
<members>Deployment__c</members>
<name>CustomObject</name>
</types>
<?xml version="1.0" encoding="UTF-8"?>
<Layout xmlns="http://soap.sforce.com/2006/04/metadata">
<layoutSections>
<customLabel>false</customLabel>
<detailHeading>false</detailHeading>
<editHeading>true</editHeading>
<label>Information</label>
<layoutColumns>
<layoutItems>
<behavior>Required</behavior>
commit d723472a2fe06028e53f3bf5225fb5793680dd95
Author: Michael Stewart <mickle00@gmail.com>
Date: Wed Jan 15 14:02:20 2014 -0800
Adding button.
diff --git a/layouts/Deployment__c-Deployment Layout.layout b/layouts/Deployment__c-Deployment Layout.layout
index afcf8c0..33a0e00 100644
--- a/layouts/Deployment__c-Deployment Layout.layout
+++ b/layouts/Deployment__c-Deployment Layout.layout
commit 192ee11660dba20d393fae1a1dc0a8cc83c0b5b5
Author: Michael Stewart <mickle00@gmail.com>
Date: Wed Jan 15 14:07:05 2014 -0800
Removing Button
diff --git a/layouts/Deployment__c-Deployment Layout.layout b/layouts/Deployment__c-Deployment Layout.layout
index 33a0e00..4604363 100644
--- a/layouts/Deployment__c-Deployment Layout.layout
+++ b/layouts/Deployment__c-Deployment Layout.layout