This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** This class is a utility class for WebServices and other API classes */ | |
global with sharing class APIUtils { | |
/** Return codes to for returnCdoe */ | |
global final static Integer STATUS_OK = 200; | |
global final static Integer STATUS_CREATED = 201; | |
global final static Integer STATUS_ACCEPTED = 202; | |
global final static Integer STATUS_BAD = 400; | |
global final static Integer STATUS_FORBIDDEN = 403; | |
global final static Integer STATUS_NOTFOUND = 404; | |
global final static Integer STATUS_NOTALLOWED = 405; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String uppercase(String name) { | |
if (name == null) { | |
return 'NULL'; | |
} | |
if (name.trim() == '') { | |
return 'BLANK'; | |
} | |
return name.toUpperCase(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
┌─┬───────────── Not used. | |
│ │ ┌─────────── Bottom Ranged | |
│ │ │ ┌───────── Bottom Melee | |
│ │ │ │ ┌─────── Middle Ranged | |
│ │ │ │ │ ┌───── Middle Melee | |
│ │ │ │ │ │ ┌─── Top Ranged | |
│ │ │ │ │ │ │ ┌─ Top Melee | |
│ │ │ │ │ │ │ │ | |
0 0 0 0 0 0 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page docType="html-5.0" showHeader="false" applyBodyTag="false" applyHtmlTag="false" standardStylesheets="false"> | |
<html ng-app="objDescApp"> | |
<head> | |
<title>Object Description</title> | |
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" /> | |
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" /> | |
<style>body{padding-top:50px}.sub-header{padding-bottom:10px;border-bottom:1px solid #eee}.navbar-fixed-top{border:0}.sidebar{display:none}@media (min-width:768px){.sidebar{position:fixed;top:51px;bottom:0;left:0;z-index:1000;display:block;padding:20px;overflow-x:hidden;overflow-y:auto;background-color:#f5f5f5;border-right:1px solid #eee}}.nav-sidebar{margin-right:-21px;margin-bottom:20px;margin-left:-20px}.nav-sidebar>li>a{padding-right:20px;padding-left:20px}.nav-sidebar>.active>a,.nav-sidebar>.active>a:focus,.nav-sidebar>.active>a:hover{color:#fff;background-color:#428bca}.main{padding: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestData { | |
public String data; | |
public TestData() {} | |
public TestData(String data) { | |
this.data = data; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger MaxCases on Case (before insert) { | |
Integer maxCases = null; | |
CaseSettings__c settings = CaseSettings__c.getValues('default'); | |
if (settings != null) { | |
maxCases = Integer.valueOf(settings.MaxCases__c); | |
} | |
if (maxCases != null) { | |
Set<Id> userIds = new Set<Id>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/usr/bin/node /home/$USER/bin/test_status.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System.debug(System.LoggingLevel.ERROR, '| vs ' + EncodingUtil.urlDecode('%7C;', 'UTF-8')); | |
if ('|' == EncodingUtil.urlDecode('%7C', 'UTF-8')) { | |
System.debug(System.LoggingLevel.ERROR, 'Expected: %7C'); | |
} else { | |
System.debug(System.LoggingLevel.ERROR, 'Unxpected: %7C'); | |
} | |
System.debug(System.LoggingLevel.ERROR, '| vs ' + EncodingUtil.urlDecode('|', 'UTF-8')); | |
if ('|' == EncodingUtil.urlDecode('|', 'UTF-8')) { | |
System.debug(System.LoggingLevel.ERROR, 'Expected: |'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Gets an admin user | |
* | |
* @return An admin user | |
*/ | |
public static User getAdminUser() { | |
Profile adminProfile = [ | |
select id | |
from profile | |
where name = 'System Administrator' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Trigger AutoConverter on Lead (after insert) { | |
LeadStatus convertStatus = [ | |
select MasterLabel | |
from LeadStatus | |
where IsConverted = true | |
limit 1 | |
]; | |
List<Database.LeadConvert> leadConverts = new List<Database.LeadConvert>(); | |
for (Lead lead: Trigger.new) { |