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
const crypto = require('crypto') | |
const fs = require('fs') | |
function sign(plainText) { | |
const sign = crypto.createSign('RSA-SHA512') | |
sign.update(Buffer.from(plainText, 'utf8')) | |
signature = sign.sign( | |
{ | |
key: fs.readFileSync('./salesforce_private.key', 'utf8'), | |
padding:crypto.constants.RSA_PKCS1_PSS_PADDING |
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 with sharing class EncryptionService { | |
// Keys are here for testing purposes. NEVER DO THIS!!! | |
// Use an approved secrets management solution like Shield Platform Encryption | |
public static final Blob PRIVATE_KEY = EncodingUtil.base64Decode( | |
'IMAGE-A-LOT-MORE-LINES-HERE\n' + | |
'MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCS7LXFvLFELXwy\n' + | |
'UVKIYJEI3j/7b4HUIOJ1IU1la1g2Vr5SKPn+GziMFhFcBjx6LlJxAkJQlOgBOnkO\n' + | |
'cHC3etOoAsrrRh4LPzZ6CXQeSRjilQnzaCdq2CIu+f8UqVWbwPtb3K/aQAX905Ck\n' + |
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
require 'restforce' | |
# set default org with sfdx | |
# sfdx config set target-org=<some username or org alias> | |
# grab the access token & instance url from the default scratch org using sfdx | |
org = JSON.parse(`sfdx org display --json`) | |
client = Restforce.new( | |
oauth_token: org['result']['accessToken'], |
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 with sharing class ClickUpTaskService { | |
private static String apiKey = ''; | |
public static void call() { | |
Http http = new Http(); | |
HttpRequest request = new HttpRequest(); | |
request.setEndpoint('https://api.clickup.com/api/v2/list/900600512507/task'); | |
request.setMethod('GET'); |
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
<aura:event type="APPLICATION" description="Add to cart event."> | |
<aura:attribute name="product" type="Product__c"/> | |
</aura:event> |
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="CustomAccountLookupController" | |
title="Search" | |
showHeader="false" | |
sideBar="false" | |
tabStyle="Account" | |
id="pg"> | |
<apex:form > | |
<apex:outputPanel id="page" layout="block" style="margin:5px;padding:10px;padding-top:2px;"> | |
<apex:tabPanel switchType="client" selectedTab="name1" id="tabbedPanel"> |
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="Contact" tabStyle="Contact" extensions="UploadAttachmentController"> | |
<apex:sectionHeader title="{!Contact.Name}" subtitle="Attach File"/> | |
<apex:form id="form_Upload"> | |
<apex:pageBlock > | |
<apex:pageBlockButtons > | |
<apex:commandButton action="{!back}" value="Back to {!Contact.Name}"/> | |
<apex:commandButton action="{!back}" value="Cancel"/> |
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 http = require('http'), | |
fs = require('fs'), | |
// NEVER use a Sync function except at start-up! | |
index = fs.readFileSync(__dirname + '/index.html'); | |
// Send index.html to all requests | |
var app = http.createServer(function(req, res) { | |
res.writeHead(200, {'Content-Type': 'text/html'}); | |
res.end(index); | |
}); |
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
<script> | |
// in the html page | |
angular.module('config', []).constant('APIKEY',''5250738f97ce29c219000011''); | |
</script> | |
myApp.controller('JobsCtrl', ['$scope', 'Jobs', 'APIKEY', function($scope, Jobs, apiKey) { | |
var promise = Jobs(apiKey).query().$promise; | |
// do more awesome programming | |
} |
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
# This code is based upon the following links: | |
# https://developer.github.com/v3/git/trees/ | |
# https://github.com/testcollab/rails-test | |
# https://stackoverflow.com/questions/23637961/how-do-i-mark-a-file-as-deleted-in-a-tree-using-the-github-api | |
# https://github.community/t/deleting-files-via-trees-no-longer-works/14042 | |
# This creates a signed commit on the correct branch, but there are 0 changed files. | |
# THIS IS THE METHOD THAT IS CALLED BY THE MAIN PROCESS TO REMOVE FILES |