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 docType="html-5.0" sidebar="false" showHeader="false" | |
standardStylesheets="false" cache="true"> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"/> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> | |
<script type="text/javascript"> | |
var SESSION_ID = '{!$Api.Session_ID}'; | |
var SERVER_URL = '{! 'https://'+ |
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 docType="html-5.0" sidebar="false" showHeader="false" | |
standardStylesheets="false" cache="true"> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"/> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> | |
<script type="text/javascript"> | |
var SESSION_ID = '{!$Api.Session_ID}'; | |
var serverURL = '{!SUBSTITUTE(SUBSTITUTE(LEFT($Api.Partner_Server_URL_210, FIND( '/services', $Api.Partner_Server_URL_260)), 'visual.force', 'salesforce'), '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
<apex:page controller="CustomerCommunityController" id="customercommunitycontroller" sidebar="false" showHeader="false" standardStylesheets="false" > | |
<head> | |
<title>Acme Customer Support</title> | |
<meta charset="utf-8" /> | |
<apex:includeScript value="{!$Resource.jquery}"/> | |
</head> | |
<script type="text/javascript"> | |
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
authorization: OAuth 00DU0000000J83v!AQoAQJkLzYuCPmfyTZ7Mmg.Otq3W6klMTqqXUsTUdfwMtk8BcZJxpNdyCfUmm5.0Psfr8j7xDoNnRuV8u7UtANm.E_ubaXCB | |
x-chatter-entity-encoding: false | |
accept: */* | |
user-agent: Ruby | |
content-type: multipart/form-data; boundary=-----------RubyMultipartPost | |
content-length: 34684 | |
-------------RubyMultipartPost | |
Content-Disposition: form-data; name="json" | |
Content-Type: application/json; charset=UTF-8 | |
Content-Transfer-Encoding: 8bit |
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
{ | |
"instance_url": "https://na12.salesforce.com", | |
"items": [{ | |
"parent": { | |
"name": "John Smith", | |
"title": null, | |
"firstName": "John", | |
"lastName": "Smith", | |
"companyName": "No company locations found", | |
"mySubscription": null, |
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
# helper that takes a feedItem hash and converts it to HTML, including | |
# properly structuring any included message segments like @mentions. | |
def message_segments(msg_segments) | |
# an array of hashes - each hash a segment | |
html = '' | |
msg_segments.each do |segment| | |
html << case segment['type'] | |
when 'Text' | |
segment['text'] |
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
# search for feed items that match text and are parented by record_id, | |
# e.g. a specific group or record feed. page_size must be a number between | |
# 1 and 100. This method doesn't handle paging, so in most cases you'll want to also | |
# add a page parameter to the query and continue to page even though no posts appear | |
# for the searched group in some pages. | |
def self.search_feed(user, record_id, text, page_size=100) | |
escaped_text = URI.escape(text, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]")) | |
items = Session.do_get(user, "/chatter/feed-items?q=#{escaped_text}&pageSize=#{page_size}") | |
# filter out items that are not part of the searched group | |
output = [] |
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 java.util.*; | |
import java.io.*; | |
import java.security.*; | |
public class ChangePassword | |
{ | |
private final static JKS j = new JKS(); | |
public static void main(String[] args) throws Exception | |
{ |
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
x = document.getElementsByClassName("debugLogLink"); | |
y = decodeURIComponent(x[0].getAttribute("href")); | |
z = y.substring(y.indexOf("'")+1); | |
p = z.substring(0,z.indexOf("'")); | |
x[0].setAttribute("href",p); | |
x[0].setAttribute("target","_blank"); |
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
#/bin/sh | |
# Creates a 1gb swap image. | |
# @see https://www.digitalocean.com/community/tutorials/how-to-configure-virtual-memory-swap-file-on-a-vps | |
if [ -f /var/swap.img ]; then | |
echo "Swap file already exists." | |
else | |
touch /var/swap.img | |
chmod 600 /var/swap.img |
OlderNewer