This file contains hidden or 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
@IsTest | |
private class UniqueIdBenchmarkingTests { | |
@IsTest | |
static void ulidBenchmark() { | |
Long ulidStartTime = System.now().getTime(); | |
System.debug('ULID generation start: ' + System.now().getTime()); | |
for (Integer i = 0; i < 1000; i++) { | |
ULID.generate(); | |
} | |
Long ulidStopTime = System.now().getTime(); |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
(function() { | |
function handlePageLoad() { | |
var endpointMatcher = new RegExp("[\\?\\&]endpoint=([^&#]*)"); | |
document.getElementById('prechatForm').setAttribute('action', | |
decodeURIComponent(endpointMatcher.exec(document.location.search)[1])); | |
} |
This file contains hidden or 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
@RestResource(urlMapping='/messagetotask') | |
global class MessageToTask { | |
@HttpPost | |
global static void incomingMessage() { | |
String expectedSignature = | |
RestContext.request.headers.get('X-Twilio-Signature'); | |
String url = 'https://' + RestContext.request.headers.get('Host') + | |
'/services/apexrest' + RestContext.request.requestURI; | |
Map <String, String> params = RestContext.request.params; |
This file contains hidden or 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="Contact" showHeader="true" sidebar="false"> | |
<script> | |
var pos = {}; | |
function success(position) { | |
pos = position.coords; | |
console.log(pos); | |
} | |
function error(msg) { |