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 jwt | |
import requests | |
import datetime | |
from simple_salesforce import Salesforce | |
from simple_salesforce.exceptions import SalesforceAuthenticationFailed | |
def jwt_login(consumer_id, username, private_key, sandbox=False): | |
endpoint = 'https://test.salesforce.com' if sandbox is True else 'https://login.salesforce.com' | |
jwt_payload = jwt.encode( | |
{ |
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 Account_Service{ | |
public static void processAccounts(){ | |
List<Account> allAccounts = [Select Id, Name, etc....]; // starting list | |
List<Account> accountsToUpdate = new List<Account>(); // empty list | |
accountsToUpdate.addAll(setOwner(allAccounts)); //return only records method1 edited | |
accountsToUpdate.addAll(copyAddress(allAccounts)); //return only records method2 edited |
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
from simple_salesforce import Salesforce, SalesforceMalformedRequest | |
from argparse import ArgumentParser | |
from csv import DictWriter | |
from datetime import date | |
from pathlib import Path | |
production_instance = 'yourinstance.salesforce.com' | |
parser = ArgumentParser(description="Backs up all Salesforce objects to csv files") | |
parser.add_argument("username", help="User to authenticate as. Should be part of an 'integration_user' profile or some profile with no ip range restriction") |
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
/** | |
* Selector for the `Account` entity | |
*/ | |
public class AccountSelector { | |
public static final AccountSelector INSTANCE = new AccountSelector(); | |
/** | |
* Finds all accounts that are child accounts of | |
* the given opportunity's account. |
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 extensions="SomeController"> | |
<script src="{!$Resource.jquery224}"></script> | |
<script>$j = jQuery.noConflict();</script> | |
<apex:form> | |
<apex:outputPanel id="someSection"> | |
... stuff here ... |
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 AccountHandler { | |
public static String insertNewAccount(String acctName) { | |
Account acct = new Account (Name = acctName); | |
try{ | |
insert acct; | |
Account returnAcct = [select id, Name from Account where Name = 'acctName' limit 1]; | |
} | |
catch (DmlException e) { | |
System.debug('A DML exception has occurred: ' + e.getMessage()); | |
} |
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<Invoice> invs=[select id, count365__c from Invoice where Invoice_Date__C > 2014-04-02]; | |
if (!invs.isEmpty()) | |
{ | |
Invoice inv=invs[0]; | |
inv.count365__c=TRUE; | |
} |
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
# --- Ruby --------------------------------------------------------------------- | |
exec { 'install_rvm': | |
command => "${as_vagrant} 'curl -L https://get.rvm.io | bash -s master'", | |
creates => "${home}/.rvm", | |
require => Package['curl'] | |
} | |
exec { 'install_ruby': | |
# We run the rvm executable directly because the shell function assumes an |
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
Vagrant::Config.run do |config| | |
config.vm.box = 'precise32' | |
config.vm.box_url = 'http://files.vagrantup.com/precise32.box' | |
config.vm.host_name = 'box' | |
config.vm.forward_port 3000, 3000 | |
config.vm.provision :puppet, | |
:manifests_path => 'puppet/manifests', | |
:module_path => 'puppet/modules' |