Skip to content

Instantly share code, notes, and snippets.

noeticpenguin /
Created Oct 21, 2013
A basic Rest Client for Salesforce's Apex
Public with sharing virtual class RestClient {
Public class RestClientException extends Exception {}
* class variable creation - DO NOT EDIT
Public Map<String,String> headers;
Public String url;
Public String method;
noeticpenguin / CommunityDebuggerCtrl.cls
Last active Apr 21, 2021
Community Debugger controller
View CommunityDebuggerCtrl.cls
public with sharing class CommunityDebuggerCtrl {
public String failingPageResponse { get; set; }
String toLoad {get; private set;}
Map<String, String> params {get; private set;}
String queryString = '?';
public CommunityDebuggerCtrl() {
params = ApexPages.currentPage().getParameters();
toLoad = (String) params.get('page');
noeticpenguin /
Created Feb 5, 2015
CommunityDebugger visualforce page
<apex:page controller="CommunityDebuggerCtrl" action="{!fetchFailingPage}" showHeader="false" sidebar="false" >
<apex:outputText id="failingPageResponse" escape="false" value="{!failingPageResponse}" />
View How to call the code coverage query via execute anonymous
toolingSoapSForceCom.SessionHeader_element sessionEl = new toolingSoapSForceCom.SessionHeader_element();
sessionEl.sessionId = UserInfo.getSessionId();
toolingSoapSForceCom.SforceService service = new toolingSoapSForceCom.SforceService();
service.SessionHeader = sessionEl;
//service.endpoint_x = //Adjust this to your endpoint, if needed...
toolingSoapSForceCom.ApexCodeCoverageAggregateQueryResult queryResult = service.queryApexCodeCoverageAggregate('Select NumLinesCovered From ApexCodeCoverageAggregate');
View gist:8427615
angular.module('myApp').config(['$httpProvider', function($httpProvider) {
delete $httpProvider.defaults.headers.common['X-Requested-With'];
noeticpenguin / pesudocode.html
Created Jan 8, 2014
bootstrapping an ng app after manual remoting calls. Jason, Essentially, you want to do this:
View pesudocode.html
<!doctype html>
<html xmlns:ng="">
Hello {{'World'}}!
<script src=""></script>
angular.element(document).ready(function() {
//manipulate results if needed.
//do whatever with results to get app ready
View reducers.js
// Write a general-purpose reducer that excludes items based on a predicate
function excludeReducer(predicate) {
return function(newArray, item) {
return predicate(item) ? newArray : newArray.concat(item);
function excludeIdReducer(id) {
return excludeReducer(function(item) {
noeticpenguin / autolink.js
Created Dec 13, 2013
example filter with trust as html for angular 1.2+
View autolink.js
View moduleAndBind.js
* app Module
* skeleton app module for skeleton directive.
var app = angular.module('app', [])
.directive('ng', ['', function(){
// Runs during compile
return {
name: 'modelAndBind',
View 2.js
[Error] Error: 'undefined' is not an object (evaluating 'self.scope.$form.$data[$attrs.eName] = newVal')
(anonymous function) (angular.js, line 8296)
(anonymous function) (angular.js, line 5967)
$digest (angular.js, line 10581)