View GeocodingUtil.cls
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 class GeocodingUtil { | |
//@future(callout=true) | |
public static void callGoogleGeocodingService() { | |
/* | |
Http httpProtocol = new Http(); | |
// Create HTTP request to send. | |
HttpRequest request = new HttpRequest(); | |
// Set the endpoint URL. | |
View MetadataSample.java
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
package com.force.samples; | |
import com.sforce.soap.enterprise.Connector; | |
import com.sforce.soap.enterprise.EnterpriseConnection; | |
import com.sforce.soap.metadata.AsyncRequestState; | |
import com.sforce.soap.metadata.AsyncResult; | |
import com.sforce.soap.metadata.MetadataConnection; | |
import com.sforce.soap.metadata.Profile; | |
import com.sforce.soap.metadata.ProfileLoginIpRange; | |
import com.sforce.soap.metadata.UpdateMetadata; |
View metadata.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
<?php | |
// Avoid clashes with classes defined in SforceHeaderOptions.php | |
namespace metadata; | |
// PHP classes corresponding to the data types in defined in WSDL | |
class checkDeployStatus { | |
/** | |
* @var string |
View restquery.py
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 os | |
import urllib | |
import urllib2 | |
import json | |
import pprint | |
# Grab credentials from the environment | |
consumer_key = os.environ['CLIENT_ID'] | |
consumer_secret = os.environ['CLIENT_SECRET'] | |
username = os.environ['USERNAME'] |
View soapdebug.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
<?php | |
require_once ('soapclient/SforcePartnerClient.php'); | |
define("SF_SECURITY_TOKEN", getenv("SECURITY_TOKEN")); | |
define("SF_USERNAME", getenv("USERNAME")); | |
define("SF_PASSWORD", getenv("PASSWORD")); | |
$mySforceConnection = new SforcePartnerClient(); | |
$mySforceConnection->createConnection("soapclient/partner.wsdl.xml"); | |
$response = $mySforceConnection->login(SF_USERNAME, SF_PASSWORD.SF_SECURITY_TOKEN); |
View SmsToLead.cls
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
/* | |
* SmsToLead.cls | |
* | |
* Shows how to receive SMS messages in Apex Code, creating Leads in a Campaign | |
*/ | |
@RestResource(urlMapping='/smstolead') | |
global class SmsToLead { | |
static TwilioAccount account = TwilioAPI.getDefaultAccount(); | |
@future(callout=true) |
View portalauth.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
<?php | |
require_once ('soapclient/SforcePartnerClient.php'); | |
function get_resource($url, $access_token) { | |
$curl = curl_init($url); | |
curl_setopt($curl, CURLOPT_HEADER, false); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($curl, CURLOPT_HTTPHEADER, | |
array("Authorization: OAuth $access_token")); | |
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); |
View Friends.page
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 controller="FriendsController"> | |
<script src="https://connect.facebook.net/en_US/all.js"></script> | |
<div id="fb-root"></div> | |
<script> | |
// Get required permissions from the controller | |
var permissions = '{!permissions}'; | |
var permlist = permissions.split(','); | |
var reqperms = ''; | |
FB.init({appId: '{!appId}', xfbml: true, cookie: true}); |
View Hello.page
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 controller="HelloController"> | |
<script src="https://connect.facebook.net/en_US/all.js"></script> | |
<div id="fb-root"></div> | |
<script> | |
// Get required permissions from the controller | |
var permissions = '{!permissions}'; | |
var permlist = permissions.split(','); | |
var reqperms = ''; | |
FB.init({appId: '{!appId}', xfbml: true, cookie: true}); |
View server.c
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
/* receive e-mail */ | |
void receive_mail(char *filename, int sock_fd) | |
{ | |
/* file descriptor for destination file */ | |
int destination_fd; | |
/* byte offset used by sendfile */ | |
off_t offset = 0; | |
OlderNewer