Skip to content

Instantly share code, notes, and snippets.

View phugee's full-sized avatar

Lance Duc Nguyen phugee

  • Skunk in the Cloud
  • Los Angeles, CA, USA
View GitHub Profile
<aura:application>
<aura:attribute name="search" type="String" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
Redirecting to search results for {!v.search}
</aura:application>
sfdx force:mdapi:deploy -u username@company.com -c -l RunLocalTests -d ./deploy/
public static String getSObjects() {
Map<String, Schema.SObjectType> sObjectMap = Schema.getGlobalDescribe();
List<String> sObjectList = new List<String>();
Set<String> sObjectNameSet = sObjectMap.keySet();
for(String sObjectName: sObjectNameSet) {
Schema.DescribeSObjectResult sObjectDescribe = Schema.getGlobalDescribe().get(sObjectName).getDescribe();
if(sObjectDescribe.isUpdateable() && sObjectDescribe.isSearchable() && sObjectDescribe.isCreateable()) {
Map<String, Schema.SObjectField> fieldMap = sObjectDescribe.fields.getMap();
List<String> fieldList = new List<String>();
for(Schema.SObjectField field: fieldMap.values()) {
@phugee
phugee / force-oauth.py
Created May 20, 2018 15:03
Another simple Python example with a real OAuth flow. This uses responses and the simple-salesforce lib
#!/usr/bin/python
import cgi
import requests
import json
from simple_salesforce import Salesforce
#login here:
#https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=3MVG9A2kN3Bn17hsWsLDatw._IVMEUBoPKv.7ksp0tz7xLX4tWDVgyzwTCA7i_yTfP.qYuNOsSoPNcdVH6DuE&redirect_uri=http://localhost/cgi-bin/python/oauth.py
private static String convertToEventReminderString(DateTime reminderDateTime, DateTime relativeDateTime) {
Long diffMilliseconds = reminderDateTime.getTime() - relativeDateTime.getTime();
Long minutes = diffMilliseconds/60000;
//case statement for minutes (0, 5, 10, 15, 30),
//if (minutes > 30) {
// //hours (1-11 hour) = {}
// if (minutes <= 660) {
// if (minutes == 60) {
// return '1 hour';
// }
<aura:event type="COMPONENT" description="Event fired when a file is selected">
<aura:attribute name="file" type="Object"
description="The file file input element that has the selected file"/>
</aura:event>
public class RestRequestController {
@AuraEnabled
public static Response service(String path, String method, String responseFormat, String bodyContent, String bodyContentType) {
HttpRequest request = buildRequest(path, method, responseFormat, bodyContent, bodyContentType);
HttpResponse httpRes = sendRequest(request);
Response restRes = buildResponse(httpRes);
return restRes;
}
Originally:
https://gist.github.com/7565976a89d5da1511ce
Hi Donald (and Martin),
Thanks for pinging me; it's nice to know Typesafe is keeping tabs on this, and I
appreciate the tone. This is a Yegge-long response, but given that you and
Martin are the two people best-situated to do anything about this, I'd rather
err on the side of giving you too much to think about. I realize I'm being very
critical of something in which you've invested a great deal (both financially