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
# create the directory for ssh | |
mkdir -p ~/.ssh | |
# make sure it's editable only for the current user | |
chmod 700 ~/.ssh | |
# create the authorized keys file | |
touch ~/.ssh/authorized_keys | |
# use your favorite editor to add the public key | |
vim ~/.ssh/authorized_keys |
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
# SSH as root to your Digital Ocean Droplet | |
ssh root@[DROPLET_IP] | |
# create the new user | |
adduser example | |
# add new user to the sudo group | |
gpasswd -a example sudo | |
# logging in with the new user | |
su - example |
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
// if you want to use it inside a visualforce page create a function around it | |
function showFollowUp() { | |
// if you want to use it in a button make sure you require jQuery | |
// {!REQUIRESCRIPT("https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js")} // UNCOMMENT IF IN A BUTTON | |
// get the dialog with your dialog name | |
var d = sfdcPage.dialogs['MyCoolDialog'], close; | |
if (!d) { | |
// if the dialog doesn't exist create one | |
d = sfdcPage.dialogs['MyCoolDialog'] = new SimpleDialog('MyCoolDialog', false); | |
// set general information on your dialog and finally run the create function |
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 'desk_api' | |
require 'csv' | |
# Create the CSV files | |
cases = CSV.open('./cases.csv', 'wb') | |
interactions = CSV.open('./interactions.csv', 'wb') | |
# Add the headers to the CSV files | |
cases << ['Case #', 'Subject', 'Description', 'Status'] | |
interactions << ['Case #', 'Body', 'Created Date'] |
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 System; | |
using System.Collections.Generic; | |
using System.Net; | |
using System.Text; | |
using System.IO; | |
using System.Security.Cryptography; | |
namespace DeskApi | |
{ | |
/// <summary> |
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 standardStylesheets="false" showHeader="false" sidebar="false" recordSetVar="macros" docType="html-5.0" | |
standardController="Macro__c" extensions="ApplyMacroControllerExtension" title="Select Macro" > | |
<apex:includeScript value=""/> | |
<apex:includeScript value="/support/console/30.0/integration.js"/> | |
<apex:includeScript value="/soap/ajax/30.0/connection.js"/> | |
<apex:includeScript value="/support/api/30.0/interaction.js"/> | |
<apex:includeScript value="/canvas/sdk/js/30.0/publisher.js"/> | |
<apex:stylesheet value="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" /> |
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 | |
/** | |
* Plugin Name: Desk.com Multipass | |
* Plugin URI: https://github.com/tstachl/wp-desk_multipass | |
* Description: A WordPress plugin to add a menu option that redirects to your Desk.com Support Site. | |
* Version: 1.0.0 | |
* Author: Thomas Stachl | |
* Author URI: https://github.com/tstachl | |
* License: BSD 3-Clause License | |
*/ |
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 Multipass | |
{ | |
private static String SITE_KEY = 'site_key'; | |
private static String API_KEY = 'api_key'; | |
public static void generate() | |
{ | |
System.debug('== Generating =='); | |
System.debug(' Create the encryption key using a 16 byte SHA1 digest of your api key and subdomain'); |
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 org.json.JSONObject; | |
import org.apache.commons.codec.binary.Base64; | |
import java.util.Arrays; | |
import java.text.DateFormat; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.net.URLEncoder; | |
import java.security.MessageDigest; |
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
<!doctype html> | |
<html> | |
<head> | |
<script src="//ajax.deskapi.com/libs/desk/opencti/current/interaction.min.js"></script> | |
<script> | |
(function() { | |
desk.ready(function() { | |
var form = document.querySelector('form') | |
, text = document.querySelector('input') | |