Skip to content

Instantly share code, notes, and snippets.

Currently being awesome

Jeff Douglas jeffdonthemic

Currently being awesome
Block or report user

Report or block jeffdonthemic

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
<aura:component >
<aura:attribute name="DayOfTheWeek" type="String"/>
<aura:if isTrue="{!v.DayOfTheWeek == 'Monday'}">
Today is Monday
<aura:if isTrue="{!v.DayOfTheWeek == 'Tuesday'}">
Today is Tuesday
<aura:if isTrue="{!v.DayOfTheWeek == 'Wednesday'}">
Today is Wednesday
jeffdonthemic / restforce_auth.rb
Last active Feb 8, 2017
Restforce and HTTParty with the Salesforce Bulk API.
View restforce_auth.rb
# sudo gem install restforce
require 'restforce'
require 'yaml'
# Initialize a client
client = :username => ENV['SFDC_USERNAME'],
:password => ENV['SFDC_PASSWORD'],
:security_token => ENV['SFDC_SECURITY_TOKEN'],
View bluebird.js
var venueCheckins = function(access_token) {
return new Promise(function(resolve, reject) {
request(''+access_token, function (error, response, body) {
if (!error && response.statusCode == 200) {
var results = JSON.parse(body);
var checkins = [];
// do magic
} else {
View app.js
var http = require('http');
var request = require('request');
var moment = require("moment");
var crypto = require('crypto');
var apiToken = 'MY-TOKEN';
var apiSecret = 'MY-SECRET';
var generateSession = function(userName, sessionName) {
var relativeUrl = "/services/api/sts/GenerateSession/"+userName+"/"+sessionName;
jeffdonthemic / AngularDemoController.cls
Created Feb 6, 2015
Hello Angular Visualforce Page & Controller
View AngularDemoController.cls
global with sharing class AngularDemoController {
// hardcode an account id for demo purposes
static String accountId = '0017000001CwYz9';
global static String getAccount() {
return JSON.serialize([select name, billingstreet,
billingcity, billingstate, billingpostalcode
from account where id = :accountId][0]);
jeffdonthemic / test.go
Created Feb 5, 2015
Go-Force Snippets
View test.go
package main
import (
jeffdonthemic / index.js
Last active Oct 4, 2019
Lambda function to commit code to github. See blog post for more details.
View index.js
var githubapi = require("github"),
async = require("async"),
AWS = require('aws-sdk'),
secrets = require('./secrets.js');
// the 'handler' that lambda calls to execute our code
exports.handler = function(event, context) {
// config the sdk with our credentials
jeffdonthemic / config.json
Created Jan 29, 2015
Download file from S3 to disk
View config.json
{ "accessKeyId": "akid", "secretAccessKey": "secret", "region": "us-east-1" }
View accountdetail_ctrl.js
'use strict';
var app = angular.module('app');
app.controller('AccountDetailCtrl', function($scope, $routeParams, Account) {
$scope.account = Account.get({id:$});
$scope.mode = 'display';
$scope.edit = function() {
View ContactListViewComponent.component
<apex:component controller="ContactListViewController">
<apex:attribute name="listViewName" type="String" required="true"
description="The name of the listview." assignTo="{!listName}"/>
<apex:enhancedList height="400" rowsPerPage="25" id="ContactList"
listId="{!listId}" rendered="{!listId != null}" />
<apex:outputText rendered="{!listId == null}" value="Could not find requewed ListView: '{!listName}'. Please contact your administrator."/>
You can’t perform that action at this time.