Skip to content

Instantly share code, notes, and snippets.

@noeticpenguin
noeticpenguin / CommunityDebugger.page
Created February 5, 2015 01:56
CommunityDebugger visualforce page
<apex:page controller="CommunityDebuggerCtrl" action="{!fetchFailingPage}" showHeader="false" sidebar="false" >
<apex:outputText id="failingPageResponse" escape="false" value="{!failingPageResponse}" />
</apex:page>
@noeticpenguin
noeticpenguin / CommunityDebuggerCtrl.cls
Last active April 21, 2021 20:43
Community Debugger controller
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
noeticpenguin / log.cls
Last active August 29, 2015 14:09
Logging class, for better identification of debug output in massive salesforce log files.
public class log {
// Usage:
// log.info('PageContructorDebug', o, 'why is my object null?');
// log.log('PageContructorDebug', o, 'why is my object null?');
// log.warn('PageContructorDebug', o, 'why is my object null?');
// log.error('PageContructorDebug', o, 'why is my object null?');
//
// For instance: log.info('PageContructorDebug', o, 'why is my object null?');
// would result in a debug block that looks like this:

Using Obj-C with MacRuby/Rubymotion

This little post aims to help you to translate Objective-C Blocks into Ruby blocks. Let's start by taking a look at few examples of iOS API call where blocks are used for animations and enumeration

Ruby Lambda Syntaxes:

Im Rubymotion and MacRuby you can use all the Ruby Lambda syntaxes that are:

block = lambda { |param|  ... }
@noeticpenguin
noeticpenguin / ExampleVFFlowPage.html
Last active August 29, 2015 14:00
Universal Redirect controller for VF Based Pages.
<apex:page Controller="FlowRedirectController">
<flow:interview name="RedirectFlow" interview="{!redirectTo}" finishLocation="{!finishLocation}" >
<!-- This Parameter is *required!* -->
<apex:param name="StartFlow" value="YOUR_FLOW_NAME_HERE" />
<!--
Any Params you need to pass into your flow.
<apex:param name="CaseId" value="{!CaseId}"/>
-->
</flow:interview>
</apex:page>

Keybase proof

I hereby claim:

  • I am noeticpenguin on github.
  • I am codefriar (https://keybase.io/codefriar) on keybase.
  • I have a public key whose fingerprint is 2C3A 62E2 921E B13F 87D7 4F0C F975 BA26 3EBA CFAA

To claim this, I am signing this object:

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');
System.debug(queryResult);
@noeticpenguin
noeticpenguin / PushTopic.java
Created March 21, 2014 13:57
df.code entries
notifyForFieldOperationCreate=true
query='SELECT ID, Name, MailingAddress FROM Account'

Deploy Rails 4 app with Dokku on DigitalOcean

Install dokku

First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel

Then ssh with root account, run this in termianl:

$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
@noeticpenguin
noeticpenguin / Gruntfile.js
Last active August 29, 2015 13:56
gruntfile
module.exports = function(grunt) {
grunt.initConfig({
jasmine: {
proposalPlus: {
// Include paths for both the local user, if we're in dev mode, as well as share mode
src: ['pp_js' + process.env.USER + '.resource/pp_js/**/*.js',
'pp_ngApp_' + process.env.USER + '.resource/pp_ngApp/**/*.js',
'pp_js/pp_js/**/*.js',
'pp_ngApp/pp_ngApp/**/*.js'
],