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
global class SearchAndReplace implements Database.Batchable<sObject>{ | |
global final String Query; | |
global final String Entity; | |
global final String Field; | |
global final String Value; | |
global SearchAndReplace(String q, String e, String f, String v){ | |
Query=q; Entity=e; Field=f;Value=v; |
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 AsyncExecutionExample implements Queueable { | |
public void execute(QueueableContext context) { | |
Account a = new Account(Name='Acme',Phone='(415) 555-1212'); | |
insert a; | |
} | |
} | |
// To execute: ID jobID = System.enqueueJob(new AsyncExecutionExample()); |
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
using Microsoft.Office.Interop.Word; | |
using System.IO; | |
namespace MSWordExample | |
{ | |
public class LineNumberingKiller | |
{ | |
static void Main(string[] args) | |
{ | |
Application word = new Application(); |
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 ForceClient | |
{ | |
public string AuthToken { get; set; } | |
public string ServiceUrl { get; set; } | |
public void Login(LoginInfo info) | |
{ | |
HttpContent content = new FormUrlEncodedContent(new Dictionary<string, string> | |
{ | |
{"grant_type", "password"}, |
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 SandboxInfo | |
{ | |
public SandboxInfo() | |
{ | |
AutoActivate = true; | |
LicenseType = "DEVELOPER"; | |
Description = "Sandbox created via API"; | |
} | |
public string SandboxName { get; set; } |
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 ForceClient | |
{ | |
// ... Further methods in the Force client. | |
public HttpResponseMessage Get(string endpoint) | |
{ | |
return Callout(HttpMethod.Get, endpoint, "{}"); | |
} | |
public HttpResponseMessage Post(string endpoint, string payload) |
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
global class PrepareMySandbox implements SandboxPostCopy { | |
global void runApexClass(SandboxContext context) { | |
System.debug('Org ID: ' + context.organizationId()); | |
System.debug('Sandbox ID: ' + context.sandboxId()); | |
System.debug('Sandbox Name: ' + context.sandboxName()); | |
// Insert logic here to prepare the sandbox for use. | |
} | |
} |
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
# https://codereview.stackexchange.com/questions/200870/powershell-script-to-deploy-repository-to-salesforce | |
param([string] $repositoryDirectory, [bool] $isProduction) | |
# TODO - git integration. Select a branch and check it out for deploy. | |
# TODO - break stuff into functions and reusable pieces. ¿piping? ¿cmdlets? | |
# TODO - Allow directory structures? | |
Write-Host -ForegroundColor green ":: Validating Repository ::" | |
$srcDirectory = [System.IO.Path]::Combine($repositoryDirectory, "src") |
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
def play | |
clear_console | |
print_menu | |
option = get_menu_option | |
factory = GameFactory.new | |
@game = factory.create_game(option) | |
clear_console | |
print_board(@game.board) |
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
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.config/nvim/bundle/Vundle.vim | |
call vundle#begin() | |
" let Vundle manage Vundle, required | |
Plugin 'VundleVim/Vundle.vim' | |
Plugin 'crusoexia/vim-monokai' " Color theme |
OlderNewer