Skip to content

Instantly share code, notes, and snippets.

@ryanguest
ryanguest / MyLoginPage.apexp
Created October 16, 2012 22:09
Community login page [Visualforce]
apex:page controller="SiteLoginController" id="loginComponent" showheader="false" standardStylesheets="false">
<h1 style="color: gray"> Community Login </h1>
<apex:form id="loginForm" forceSSL="true">
<apex:outputPanel layout="block">
<apex:pageMessages id="error"/>
<apex:outputLabel value="{!$Label.site.username}" for="username"/>
<apex:inputText id="username" value="{!username}"/>
<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">
@ryanguest
ryanguest / gist:5860817
Last active December 18, 2015 23:19 — forked from henriquez/gist:3146782
<apex:page id="customercommunitycontroller" sidebar="false" showHeader="false" standardStylesheets="false" >
<head>
<title>Acme Customer Support</title>
<meta charset="utf-8" />
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"/>
</head>
<script type="text/javascript">
public class StateUtil {
Map<String,String> stateMap = new Map<String,String>();
public StateUtil(){
stateMap.put('Alabama','AL');
stateMap.put('Alaska','AK');
stateMap.put('Arizona','AZ');
stateMap.put('Arkansas','AR');
stateMap.put('California','CA');
stateMap.put('Colorado','CO');
@ryanguest
ryanguest / ContentDocumentLink.apex
Created June 25, 2015 20:22
ContentDocumentLink example from Apex
public with sharing class TestController {
public String output { get; set; }
public PageReference run() {
String url = 'https://na1.salesforce.com/services/data/v23.0/chatter/feeds/news/me';
HttpRequest req = new HttpRequest();
req.setMethod('GET');