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
import { | |
login, | |
queryGenerator, | |
deleleSobject, | |
query, | |
executeAnonymous, | |
} from "@common/promisify-js-force"; | |
import { chunk } from "lodash"; | |
export const main_handler = async (event, context, callback) => { |
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
/** | |
* Copyright (c), Andrew Fawcett | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without modification, | |
* are permitted provided that the following conditions are met: | |
* | |
* - Redistributions of source code must retain the above copyright notice, | |
* this list of conditions and the following disclaimer. | |
* - Redistributions in binary form must reproduce the above copyright notice, |
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
var loadScript = (src)=>{ | |
return new Promise( (resolve, reject)=>{ | |
var script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.src = src; | |
script.onload = resolve; | |
script.onerror = reject; | |
document.head.appendChild(script); | |
} ); |
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
List<String> targetList = new List<String>{'B01LR7151C','B06XY77N5N','B072J83YSM','B019YHGHX8','B01K5BTJH8','B01GIIVF6K','B003F6WENW','B0027TEADK','B012PJVQ7Y','B01IG0E1F0','B0072V6MIO','B0727TW22T','B01G7UJIVI','B01AIW6KZS','B00MH78O0M','B0756T5CD4'}; | |
for(String target: targetList){ | |
HttpRequest req = new HttpRequest(); | |
Http http = new Http(); | |
req.setEndpoint('https://www.amazon.com/product-reviews/'+target); | |
req.setMethod('GET'); | |
// req.setBody('{}'); |
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 standardController="b25efasiav1__Course_Map__c" extensions="Ctrl_Create_CourseMap"> | |
<head> | |
<apex:stylesheet value="{!URLFOR($Resource.SLDS, 'assets/styles/salesforce-lightning-design-system.min.css')}" /> | |
<style> | |
body { | |
font-size: 75%; | |
} | |
</style> | |
</head> |
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
String key = 'hgdhdhhdjfh12ehsn'; | |
String secret = 'DNf32sdsj747dhkjd8893jjjdjds7jjk'; | |
//Generating current Unix timestamp (in seconds) | |
String getTime = string.valueOf(Datetime.Now().getTime()/1000); | |
String requestInput = key + secret + getTime; | |
Blob requestBlob = Blob.valueOf(requestInput); | |
Blob hash = Crypto.generateDigest('MD5', requestBlob); | |
//Need to convert into hex to generate the equivalent of md5(string) method of PHP. |
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 getAllQuery(String query) { | |
String result = ''; | |
String regex = '^select\\s+\\*\\s*(?:,\\s*[^\\s]+\\s*)*\\s+from\\s+([^\\s]+)(.*)$'; | |
Matcher m = Pattern.compile(regex).matcher(query.toLowerCase()); | |
if(m.matches()) { | |
String sObjectName = m.group(1); | |
Schema.SObjectType targetType = Schema.getGlobalDescribe().get(sObjectName); | |
Map<String, Schema.SObjectField> fieldMap = targetType.getDescribe().fields.getMap(); |
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
/** | |
* Title | |
* | |
* @author | |
* @version 1.0 | |
* @description | |
* @uses | |
* @history | |
* yyyy-mm-dd : | |
*/ |
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
/** | |
* 工具类 | |
* created by Harry 2016-12-08 21:22:18 | |
*/ | |
public without sharing class Utils { | |
//最小日期 | |
public static final String MIN_DATE_TIME = '2000-01-01 00:00:00'; | |
public static final String DATE_FORMAT_STR = 'yyyy-MM-dd';//默认日期文本格式 | |
public static final String DATETIME_FORMAT_STR = 'yyyy-MM-dd HH:mm:ss';//默认时间文本格式 | |
//记录类型缓存 |